Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #501: add maybe_update_issue_milestone step #896

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leplatrem
Copy link
Contributor

Fix #501

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 5, 2024
@leplatrem leplatrem force-pushed the 501-sync-milestone branch from 841e82d to fbc867c Compare March 6, 2024 11:16
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Mar 6, 2024
@leplatrem leplatrem force-pushed the 501-sync-milestone branch from fbc867c to 592cdba Compare March 6, 2024 11:50
@leplatrem
Copy link
Contributor Author

@cpeterso would that logic work for you as an MVP?

else:
jira_fix_versions = []

resp = jira_service.update_issue_field(context, "fixVersions", jira_fix_versions)
Copy link
Contributor

@cpeterso cpeterso Mar 6, 2024

Choose a reason for hiding this comment

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

Does this update work with field name fixVersions? I think fixVersions (plural) should be fixVersion (singular). The field is displayed as "Fix versions" in the Jira issue UI, but it is called fixVersion (singular) in JQL queries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird. fixVersions is a system field (does not seem custom), and I don't see why it would be singular in JQL.

These are the fields with version in their name on our Jira instance:

[
   {
      "id":"customfield_10747",
      "key":"customfield_10747",
      "name":"App Version",
      "untranslatedName":"App Version",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "App Version",
         "App Version[Paragraph]",
         "cf[10747]"
      ],
      "schema":{
         "type":"string",
         "custom":"com.atlassian.jira.plugin.system.customfieldtypes:textarea",
         "customId":10747
      }
   },
   {
      "id":"customfield_10463",
      "key":"customfield_10463",
      "name":"Version",
      "untranslatedName":"Version",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "cf[10463]",
         "Version",
         "Version[Short text]"
      ],
      "schema":{
         "type":"string",
         "custom":"com.atlassian.jira.plugin.system.customfieldtypes:textfield",
         "customId":10463
      }
   },
   {
      "id":"customfield_10315",
      "key":"customfield_10315",
      "name":"Changed Fix Versions",
      "untranslatedName":"Changed Fix Versions",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "cf[10315]",
         "Changed Fix Versions",
         "Changed Fix Versions[Paragraph]"
      ],
      "schema":{
         "type":"string",
         "custom":"com.atlassian.jira.plugin.system.customfieldtypes:textarea",
         "customId":10315
      }
   },
   {
      "id":"customfield_10184",
      "key":"customfield_10184",
      "name":"Targeted version and channel",
      "untranslatedName":"Targeted version and channel",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "cf[10184]",
         "Targeted version and channel",
         "Targeted version and channel[Dropdown]"
      ],
      "schema":{
         "type":"option",
         "custom":"com.atlassian.jira.plugin.system.customfieldtypes:select",
         "customId":10184
      }
   },
   {
      "id":"customfield_10185",
      "key":"customfield_10185",
      "name":"Rollout will become default in version:",
      "untranslatedName":"Rollout will become default in version:",
      "custom":true,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "cf[10185]",
         "Rollout will become default in version:",
         "Rollout will become default in version:[Dropdown]"
      ],
      "schema":{
         "type":"option",
         "custom":"com.atlassian.jira.plugin.system.customfieldtypes:select",
         "customId":10185
      }
   },
   {
      "id":"fixVersions",
      "key":"fixVersions",
      "name":"Fix versions",
      "custom":false,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "fixVersion"
      ],
      "schema":{
         "type":"array",
         "items":"version",
         "system":"fixVersions"
      }
   },
   {
      "id":"versions",
      "key":"versions",
      "name":"Affects versions",
      "custom":false,
      "orderable":true,
      "navigable":true,
      "searchable":true,
      "clauseNames":[
         "affectedVersion"
      ],
      "schema":{
         "type":"array",
         "items":"version",
         "system":"versions"
      }
   }
]

Copy link
Contributor

Choose a reason for hiding this comment

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

Weird. fixVersions is a system field (does not seem custom), and I don't see why it would be singular in JQL.

I haven't used Jira's API, but when I search with JQL fixVersions = Fx124, Jira returns an error:

Field 'fixVersions' does not exist or you do not have permission to view it.

https://mozilla-hub.atlassian.net/issues/?jql=fixVersions%20%3D%20Fx124

When I search with fixVersion = Fx124, Jira returns a list of 162 issues:

https://mozilla-hub.atlassian.net/issues/?jql=fixVersion%20%3D%20Fx124

@cpeterso
Copy link
Contributor

cpeterso commented Mar 6, 2024

@cpeterso would that logic work for you as an MVP?

I can't say anything about this Python code, but the PR's logic to map Bugzilla's NNN Branch to Jira's FxNNN or Release NNN looks OK to me. I added some questions in the PR.

)
if not jira_fix_versions:
logger.info(
"Bug %s milestone %r has no matching version in project.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Where will the "Bug %s milestone %r has no matching version in project." errors be logged when a Bugzilla Milestone name doesn't match the Jira Release? Is that information only available to JBI admins?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are application/server logs that end-up in Google Cloud console. We currently don't have any way to send alerts to users (we could consider adding a comment on the bug or on the Jira issue)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync Bugzilla's "Milestone" version field to Jira's "Fix versions" field
2 participants