-
Notifications
You must be signed in to change notification settings - Fork 280
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: flatten project falls back to organization default template ID #626
Conversation
The Azure DevOps API does not guarantee a process template ID will be returned when getting a project detail. This seems to be caused for projects which use the organization default template. As such, the lookup logic should fallback to that value, if none is present at the project level. Thanks @tmeckel for the suggested implementation. Fixes microsoft#199
@wwmoraes this issue is still not fixed, fallback to ORG default template may set the wrong template result in a state |
Thank you @xuzhang3 for the review! I've updated the code to remove the hardcoded
This also has the side-effect that future changes on the organisation default template will cause all resources without |
@wwmoraes I do not think change the default value to empty string and set it to the default organization process template is the best choice
|
@xuzhang3 thank you again for reviewing it 😄
This is exactly how the upstream service works: the organization itself has a default. Having a custom hardcoded value here means this provider has a distinct behaviour than the upstream service, which increases cognitive load. Mitigating an eventual recreation diff seems like a poor reason to do that. Besides, infrastructure-as-code is meant to be declarative, so a customer is prone to uncontrolled changes for things they do not explicitly configure, which seems fair.
I've updated the docs mentioning that the default is the one set on the organization. The empty string on the schema is due to the "offline" approach used for its creation. We could change the schema during initialization using the configure context function, but that wouldn't solve the declared empty string you're referring to. If you mean the upstream service documentation is unclear about this then that's a problem of the upstream service provider.
If you mean the original issue, #199, then its not a permission issue: one of the users that tested it is the organization owner. |
@wwmoraes thanks for your feedback, I would like to keep the default type to |
f4ad572
to
375982f
Compare
An empty string work item template will query the organization to retrieve the default work item template ID. This copes with the TF provider design choice to have a hardcoded value on the provider, even though the provided service has no such thing. This means existing customers will not be impacted: a missing work item template parameter will still fallback to the hardcoded Agile.
@xuzhang3 would you be so kind as to review it again? I've reinstated the |
@wwmoraes LGTM 🚢 |
The Azure DevOps API does not guarantee a process template ID will be returned when getting a project detail. This seems to be caused for projects which use the organisation default template. As such, the lookup logic should allow to fallback to that value, if none is present at the project level.
The changes introduced allow an empty work item template parameter, which will force a lookup on the organisation level. The default value is kept as
Agile
for compatibility and design choices.Fixes #199
All Submissions:
What about the current behavior has changed?
Issue Number:
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information