terraform-provider-gitlab
terraform-provider-gitlab copied to clipboard
gitlab_service_jira password not set
Terraform Version
Terraform v0.14.5
Affected Resource(s)
- gitlab_service_jira
Terraform Configuration Files
resource "gitlab_service_jira" "my_project" {
project = gitlab_project.my_project.id
url = "https://myjiraserver.tld"
username = "user"
password = var.jira_password
project_key = "XXXX"
jira_issue_transition_id = "123"
commit_events = true
merge_requests_events = true
comment_on_event_enabled = false
Expected Behavior
this resource should configure the jira Integration password included
Actual Behavior
it creates the jira integration except password which is not set and stays blank.
Steps to Reproduce
- add configuration of a gitlab_service_jira resources with a password
-
terraform apply
- on gitlab side check the integration and test the connection. you should have a message with "password can't be blank"
Marking this issue as stale due to 90 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 14 days it will automatically be closed. Maintainers can also remove the stale
label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Hello. Can you run your apply
with TF_LOG=DEBUG
and attach a gist with the debug logs? I looked at the code and it appears to be including the password in the API call correctly. Also please include the version of the provider you are using. It's possible this was fixed since the original report.
Hello. I have a similar problem - my jira integration after creation doesn't shout that the password is blank, but the error message is 'Validation failed'. After putting the right password in the field in gui, it starts to work - even if I DON'T press 'save changes' button. Just 'Test connection' and it works after reloading the page.
Here is the debug log from the creation phase: https://gist.github.com/ftpd/3e697a77799af0f2e98aea2d61e65388
Terraform version: 1.0.10, provider version: 3.9.1.
@ftpd I have experienced this but it appears that the password is validly set until you either go to the Integration page in GitLab for Jira or you click the test button on the integration. I am unsure that this is a provider issue and might be more of a GitLab issue. @ftpd or @valvin1 If you could run the provider, configure the JIRA integration and test that the integration on the project works without navigating to the JIRA integration configuration page that might confirm my suspicions.
It doesn't work for me after just creating an integration. Clicking test button gives 'Validation failed', I have to manually insert password in the corresponding field in Jira itself.
@ftpd One last test then can you try setting the same settings via the API and see if that works. No terraform involved just a PUT request to the API. Also please note which version of GitLab you are using. https://docs.gitlab.com/ee/api/integrations.html#jira
@ftpd Could you please run the terraform apply
with TF_LOG=debug
to see the request made to GitLab - and please redact the output to not leak any secrets ;) - and post it here? :)
@timofurrer the whole log from apply with debug is in my gist in https://github.com/gitlabhq/terraform-provider-gitlab/issues/672#issuecomment-1044168426
@ftpd sorry my bad 🤦 I'll dig into this a little bit more in depth later. For now, the active
field looks suspicious .. it's an optional field which activates the integration and defaults to false ... the provider doesn't set it nor allows to set it ...
... and maybe that the password
field appears blank in the UI (it seems to be sent via API) is just because of security concerns ... and you need to re-enter (just guessing here ...)
Can you try and manually do the API call from the logs, but add the activate
field set to true
?
Just saw in the response that it's actually active 🤔
https://registry.terraform.io/providers/gitlabhq/gitlab/latest/docs/resources/service_jira says the active
field is read-only. For me it looks like it becomes active automagically when the integration is applied.
I will try some manual approach with API calls and get back with response.
One last test then can you try setting the same settings via the API and see if that works. No terraform involved just a PUT request to the API. Also please note which version of GitLab you are using.
@Shocktrooper I did the test. 'Validation failed', just like when creating via terraform - so it looks like it's not provider's fault indeed (warning: @valvin1 still can have a problem with provider, as mine is slightly different). Any advices welcomed, anyway.
The github version - I'm using gitlab.com, so I assume 'current' ;-)
Any advices welcomed, anyway.
I think it makes sense to open an issue here: https://gitlab.com/gitlab-org/gitlab/-/issues
@valvin1 any more information from your side?
Just to make things clear: for me the password field is also blank, but I assume it's the expected look&feel - when creating the integration manually, (via the web) putting it there and clicking Save Changes, the field appears blank, despite the password is there and everything works.
@valvin1 bump for timofurrers comment above
Marking this issue as stale due to 120 days of inactivity. If this issue receives no comments in the next 30 days it will be closed. Maintainers can also remove the stale
label.
Please comment with more information if you would like this issue to remain open.
Closing issue as no further feedback was added from end users