Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Team import doesn't set the organisation #35

Closed
lyz-code opened this issue May 10, 2023 · 6 comments · Fixed by #38
Closed

Team import doesn't set the organisation #35

lyz-code opened this issue May 10, 2023 · 6 comments · Fixed by #38
Assignees
Labels
blocked Blocked by dependency bug Something isn't working

Comments

@lyz-code
Copy link

Describe the bug
When importing a team the required organisation field is not set. So when you try to do a plan the resource gets replaced as it's trying to change from "" to the value you want to set.

To Reproduce
Steps to reproduce the behavior:

  1. Import a team
  2. Do a terraform plan

Expected behavior
When importing an organisation team, the organisation field should be set in the state.

Log Output
If applicable, add logs to help explain your problem.

Additional Data
Important for reproducability.

  • Terraform Version: v0.13.1

  • Operating System: Linux

  • Provider Version: v0.12.3

@lyz-code lyz-code added the bug Something isn't working label May 10, 2023
@lyz-code
Copy link
Author

It seems that the team members are not imported either, this is not that bad because in the first apply they are overwritten

@Lerentis Lerentis self-assigned this May 15, 2023
Lerentis added a commit that referenced this issue May 15, 2023
@Lerentis
Copy link
Owner

Lerentis commented May 15, 2023

Hi @lyz-code ,

i can confirm your observation and in theory the fix for it should be easy, but there seems to be a bug in the gitea api where a GET /teams/{id} returns null for the organization field...

{
  "id": 13,
  "name": "test_team",
  "description": "test team of test org",
  "organization": null,
  "includes_all_repositories": true,
  "permission": "admin",
  "units": [
    "repo.releases",
    "repo.projects",
    "repo.packages",
    "repo.pulls",
    "repo.wiki",
    "repo.ext_wiki",
    "repo.code",
    "repo.issues",
    "repo.ext_issues"
  ],
  "units_map": {
    "repo.code": "admin",
    "repo.ext_issues": "admin",
    "repo.ext_wiki": "admin",
    "repo.issues": "admin",
    "repo.packages": "admin",
    "repo.projects": "admin",
    "repo.pulls": "admin",
    "repo.releases": "admin",
    "repo.wiki": "admin"
  },
  "can_create_org_repo": true
}

this needs to be fixed upstream i fear

@Lerentis Lerentis added the blocked Blocked by dependency label May 15, 2023
@Lerentis
Copy link
Owner

Reported upstream here: go-gitea/gitea#24734

if you would like to add anything to my description feel free to add your comment there 😃

@lyz-code
Copy link
Author

Thank you for taking care of it, and damn they are fast fixing bugs!

@Lerentis
Copy link
Owner

indeed 😃 now just need to wait until this is released and i need to check the version where the fix is present in order to not break the functionality for older gitea releases. will update this issue when i release the fix.
thanks again for the report

Lerentis added a commit that referenced this issue May 17, 2023
@Lerentis Lerentis linked a pull request May 17, 2023 that will close this issue
Lerentis added a commit that referenced this issue Jul 4, 2023
@Lerentis
Copy link
Owner

Lerentis commented Jul 4, 2023

missed the gitea release but it should now be fixed and released as v0.14.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Blocked by dependency bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants