-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Addition of Installation Type field in Jira Source Proto [INS-79] #4564
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
Addition of Installation Type field in Jira Source Proto [INS-79] #4564
Conversation
1d9983d to
141b4e6
Compare
| enum JiraInstallationType { | ||
| JIRA_INSTALLATION_TYPE_AUTODETECT = 0; | ||
| JIRA_INSTALLATION_TYPE_CLOUD = 1; | ||
| JIRA_INSTALLATION_TYPE_DATA_CENTER = 2; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good practice (mentioned in the protobuf guide) to have the first value of the enum be ENUM_TYPE_NAME_UNSPECIFIED or ENUM_TYPE_NAME_UNKNOWN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I was just following convention. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it's a matter of what we've been doing and what's the right way of doing it....... I'm not sure about this.
Personally I agree with the guide. Having the default value of the enum be an UNKNOWN value makes sense because then your downstream application can know that the caller did not explicitly specify a value. In our case, we would probably map this UNKNOWN to AUTODETECT, but still there will be a way to differentiate if the user actually wanted AUTODETECT or if they just didn't specify a value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great callout! :) But in this particular case, we (well, I) consciously chose for AUTODETECT to be the "unknown" option. No user is ever going to explicitly configure AUTODETECT because it's documented as the default, so there is a nice congruence between "default behavior" and "unspecified behavior."
And while maybe the choice I made was not the best one, I believe that it's important to make the same choice here so we get the benefits of consistency. If either of you feel more strongly the other way though, let's have a broader conversation about it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense; consistency is a solid point.
I'm fine with keeping it as AUTODETECT or following the best practice.
I requested a review from @camgunz just for visibility / another perspective since you mentioned a broader discussion could make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going ahead with the initial implementation (as suggested by Cody as well).
f01eeec to
141b4e6
Compare
Add configuration option to override Jira installation type autodetection (Cloud vs Data Center).
Problem
Currently, we autodetect whether a Jira instance is Cloud or Data Center by making a HEAD request to a cloud-only endpoint. If the endpoint returns 404, it's assumed to be Data Center; otherwise, it's Cloud.
This autodetection could fail if:
Solution
Added
installation_typefield to the Jira source configuration.Checklist:
make test-community)?make lintthis requires golangci-lint)?