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

Added external Wiki service #1003

Merged
merged 7 commits into from Apr 3, 2022
Merged

Added external Wiki service #1003

merged 7 commits into from Apr 3, 2022

Conversation

Shocktrooper
Copy link
Collaborator

Resolves #996

@Shocktrooper Shocktrooper marked this pull request as ready for review April 2, 2022 02:44
Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

Thanks. Just found a test bug.

Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

Test failed

Error running post-test destroy, there may be dangling resources: [ERROR] External Wiki Service 89 still exists

@Shocktrooper
Copy link
Collaborator Author

@armsnyder I wonder if this is the downstream API as looking at the code nothing is apparent. I will check the GitLab API and see what it returns after some testing.
I found this in the docs
https://docs.gitlab.com/ee/api/integrations.html#:~:text=Disable%20the%20External%20wiki%20integration%20for%20a%20project.%20Integration%20settings%20are%20preserved.

@Shocktrooper
Copy link
Collaborator Author

Yup it appears there is an active flag that is set to false on delete. I will refactor the resource to include this computed field

@Shocktrooper
Copy link
Collaborator Author

@armsnyder After looking at the other integrations code I believe most if not all of them need to have their resource + unit tests updated to include the active flag + some computed fields. The unit tests for destruction verification seem to rely on the project being marked for deletion vs the integration being deactivated on top of a 404 being impossible to get after an integration is activated the first time.

@armsnyder
Copy link
Collaborator

armsnyder commented Apr 2, 2022

Thanks for updating the code to match the other services. There's a new test failure now:

resource_gitlab_service_external_wiki_test.go:24: Step 3/6 error: Check failed: Check 4/4 error: gitlab_service_external_wiki.this: Attribute 'updated_at' expected "2022-04-02T05:12:58Z", got "2022-04-02T05:13:01Z"
[277](https://github.com/gitlabhq/terraform-provider-gitlab/runs/5797570330?check_suite_focus=true#step:8:277)

It looks like in the test you are comparing CreatedAt and UpdatedAt

testCheckResourceAttrLazy(externalWikiResourceName, "updated_at", func() string { return externalWikiService.CreatedAt.Format(time.RFC3339) }),

Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

lgtm thanks!

@armsnyder armsnyder merged commit af538dc into gitlabhq:main Apr 3, 2022
@armsnyder armsnyder added this to the v3.14.0 milestone Apr 3, 2022
@Shocktrooper Shocktrooper deleted the ExtWiki branch April 3, 2022 06:22
@github-actions
Copy link

github-actions bot commented May 2, 2022

This functionality has been released in v3.14.0 of the Terraform GitLab Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue. Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants