Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix organization field being null in GET /api/v1/teams/{id} #24694

Merged
merged 2 commits into from May 13, 2023

Conversation

yardenshoham
Copy link
Member

Enabled the organization loading flag.

Before

{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}

After

{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}

Enabled the organization loading flag.

# Before
```json
{
  "id": 1,
  "name": "Owners",
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  "units": [
    "repo.code",
    "repo.issues",
    "repo.wiki",
    "repo.ext_wiki",
    "repo.actions",
    "repo.ext_issues",
    "repo.pulls",
    "repo.releases",
    "repo.projects",
    "repo.packages"
  ],
  "units_map": {
    "repo.actions": "owner",
    "repo.code": "owner",
    "repo.ext_issues": "owner",
    "repo.ext_wiki": "owner",
    "repo.issues": "owner",
    "repo.packages": "owner",
    "repo.projects": "owner",
    "repo.pulls": "owner",
    "repo.releases": "owner",
    "repo.wiki": "owner"
  },
  "can_create_org_repo": true
}
```

# After
```json
{
  "id": 1,
  "name": "Owners",
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  "units": [
    "repo.ext_issues",
    "repo.pulls",
    "repo.wiki",
    "repo.ext_wiki",
    "repo.packages",
    "repo.code",
    "repo.issues",
    "repo.releases",
    "repo.projects",
    "repo.actions"
  ],
  "units_map": {
    "repo.actions": "owner",
    "repo.code": "owner",
    "repo.ext_issues": "owner",
    "repo.ext_wiki": "owner",
    "repo.issues": "owner",
    "repo.packages": "owner",
    "repo.projects": "owner",
    "repo.pulls": "owner",
    "repo.releases": "owner",
    "repo.wiki": "owner"
  },
  "can_create_org_repo": true
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 13, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 13, 2023
@yardenshoham yardenshoham added type/bug modifies/api This PR adds API routes or modifies them outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels May 13, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 13, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 13, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 13, 2023
@lunny lunny added this to the 1.20.0 milestone May 13, 2023
@silverwind silverwind enabled auto-merge (squash) May 13, 2023 14:14
Copy link
Member

@lunny lunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to have a test for that.

@silverwind silverwind merged commit 542adf5 into go-gitea:main May 13, 2023
15 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 13, 2023
GiteaBot added a commit to GiteaBot/gitea that referenced this pull request May 13, 2023
…-gitea#24694)

Enabled the organization loading flag.

- Fixes go-gitea#20399 

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label May 13, 2023
@yardenshoham yardenshoham deleted the issues/20399 branch May 13, 2023 15:11
silverwind pushed a commit that referenced this pull request May 13, 2023
…4694) (#24696)

Backport #24694 by @yardenshoham

Enabled the organization loading flag.

- Fixes #20399 

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 15, 2023
* upstream/main: (30 commits)
  Don't filter action runs based on state (go-gitea#24711)
  Add Go package registry (go-gitea#24687)
  Fix flash of unstyled content in action view page (go-gitea#24712)
  Clean up various avatar dimensions (go-gitea#24701)
  Remove the parallelizing when loading repo for dashboard (go-gitea#24705)
  Optimize actions list by removing an unnecessary `git` call (go-gitea#24710)
  Update cron-translations.yml (go-gitea#24708)
  Fix run list broken when trigger user deleted (go-gitea#24706)
  Remove Fomantic comment module (go-gitea#24703)
  Update to Alpine 3.18 (go-gitea#24700)
  fix minio storage iterator path (go-gitea#24691)
  Add status indicator on main home screen for each repo (go-gitea#24638)
  Add test for api team orgnization (go-gitea#24699)
  Improve button-ghost, remove tertiary button (go-gitea#24692)
  Add icon support for safari (go-gitea#24697)
  Improve avatar uploading / resizing / compressing, remove Fomantic card module (go-gitea#24653)
  Fix docs documenting invalid `@every` for `OLDER_THAN` cron settings (go-gitea#24695)
  Fix `organization` field being `null` in `GET /api/v1/teams/{id}` (go-gitea#24694)
  Use standard HTTP library to serve files (go-gitea#24693)
  Add `eslint-plugin-eslint-comments` (go-gitea#24690)
  ...
Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this pull request Jun 3, 2023
…-gitea#24694) (go-gitea#24696)

Backport go-gitea#24694 by @yardenshoham

Enabled the organization loading flag.

- Fixes go-gitea#20399

# Before
```json
{
  ...
  "description": "",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

# After
```json
{
  ...
  "description": "",
  "organization": {
    "id": 2,
    "name": "bigorg",
    "full_name": "",
    "avatar_url": "https://3000-yardenshoham-gitea-3gfrlc9gn4h.ws-us96b.gitpod.io/avatars/e2649b0c016d9102664a7d4349503eb9",
    "description": "",
    "website": "",
    "location": "",
    "visibility": "public",
    "repo_admin_change_team_access": true,
    "username": "bigorg"
  },
  "includes_all_repositories": true,
  "permission": "owner",
  ...
}
```

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit da1c38d)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them outdated/backport/v1.19 This PR should be backported to Gitea 1.19 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Organization is null from GET team API
5 participants