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: support more vcs-type fields in module creation #1006

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

fixes #1002
fixes #1004

Solution

  1. Ignoring modules with isDeleted set to true (fixes env0_module resource does not detect changes in ENV0 UI #1004).
  2. Updated the acceptance tests.
  3. Added the missing is*** fields to support additional vcs types.
  4. Updated the structs to support the additional fields.

@@ -43,7 +46,10 @@ type ModuleCreatePayload struct {
TokenName string `json:"tokenName,omitempty"`
GithubInstallationId *int `json:"githubInstallationId,omitempty"`
BitbucketClientKey string `json:"bitbucketClientKey,omitempty"`
IsGitlab *bool `json:"isGitLab,omitempty"`
IsGitlab bool `json:"isGitLab"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

default is false. Not sure why this was ever a pointer.

@@ -12,12 +12,6 @@ import (
)

func resourceModule() *schema.Resource {
vcsExactlyOneOf := []string{
Copy link
Collaborator Author

@TomerHeber TomerHeber Jan 24, 2025

Choose a reason for hiding this comment

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

using conflictsWith instead.
Due to this comment:
when isGitLabEnterprise is true the token_id and token_name should not be required

@TomerHeber
Copy link
Collaborator Author

/review

@bot-env0 bot-env0 requested a review from a team January 24, 2025 16:35
Copy link
Contributor

@Wassap124 Wassap124 left a comment

Choose a reason for hiding this comment

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

Looks good!

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jan 29, 2025
@@ -119,6 +113,30 @@ func resourceModule() *schema.Resource {
Optional: true,
Default: false,
},
"is_gitlab": {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not using conflictsWith for these as well?
GL can't be BBS for example, seems like a good validation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure!

@TomerHeber TomerHeber merged commit 078dfec into main Jan 30, 2025
4 checks passed
@TomerHeber TomerHeber deleted the fix-support-more-vcs-types-#1002 branch January 30, 2025 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client fix provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env0_module resource does not detect changes in ENV0 UI Support vcs-type fields in module creation
3 participants