Skip to content

fix: Added all event types that the Python code handles (SRV-214)#127

Closed
vsaltxx wants to merge 3 commits into
espressif:v1from
vsaltxx:fix/close-issue-when-status-resolved
Closed

fix: Added all event types that the Python code handles (SRV-214)#127
vsaltxx wants to merge 3 commits into
espressif:v1from
vsaltxx:fix/close-issue-when-status-resolved

Conversation

@vsaltxx
Copy link
Copy Markdown
Contributor

@vsaltxx vsaltxx commented Apr 17, 2026

Description

  • The issues event is configured to trigger only on opened. It completely misses closed, reopened, edited, labeled, unlabeled, and deleted events.

    The workflow was newer triggered on closed event.

    Most probably the closed status was synchronised after being triggered on the issue_comment event. If someone commented after closing → the workflow ran, the comment synced, but the closed status still never synced. If no one commented → the workflow never ran at all for that issue.

  • Unrelated change: issue.update() was called before the None check, crashing with AttributeError instead of the expected JIRAError. Moved both calls inside the if issue is not None: guard.

Solution

Add all event types that the Python code handles: opened, edited, closed, deleted, reopened, labeled, unlabeled.

The amount of Action run will increase, but the change will not influence the billing since the repo is public.
Screenshot 2026-04-17 at 11 25 59

Related

Fixes: Github resolution status is not reliably synced to Jira (SRV-66)

Testing

Please see added tests.

Copilot AI review requested due to automatic review settings April 17, 2026 09:08
@vsaltxx vsaltxx requested a review from a team as a code owner April 17, 2026 09:08
@vsaltxx vsaltxx requested review from kumekay and removed request for a team April 17, 2026 09:08
@vsaltxx vsaltxx marked this pull request as draft April 17, 2026 09:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GitHub Actions workflow to trigger on all issues event types that the sync code supports, to ensure Jira state stays in sync across more issue lifecycle changes.

Changes:

  • Expanded .github/workflows/sync-jira.yml issues.types to include opened, edited, closed, deleted, reopened, labeled, and unlabeled.
  • Adjusted handle_issue_closed to avoid updating Jira fields when no Jira issue is returned.
  • Added a test intended to validate that the workflow triggers on selected issue actions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
tests/test_sync_issue.py Adds a workflow-trigger test that reads the workflow YAML to validate configured issue action types.
sync_jira_actions/sync_issue.py Moves the “set Closed” Jira field update under an issue is not None guard.
.github/workflows/sync-jira.yml Expands workflow triggers for the issues event to include all supported action types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/sync-jira.yml
Comment thread tests/test_sync_issue.py Outdated
Comment thread tests/test_sync_issue.py Outdated
Comment thread tests/test_sync_issue.py Outdated
@vsaltxx vsaltxx force-pushed the fix/close-issue-when-status-resolved branch from aa794b9 to 1e0bd61 Compare April 17, 2026 09:11
@vsaltxx vsaltxx force-pushed the fix/close-issue-when-status-resolved branch from 1e0bd61 to 124df8a Compare April 17, 2026 09:15
@vsaltxx vsaltxx requested a review from Copilot April 17, 2026 09:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vsaltxx vsaltxx force-pushed the fix/close-issue-when-status-resolved branch 2 times, most recently from 654db4c to 0f334ee Compare April 17, 2026 09:39
@vsaltxx vsaltxx requested a review from Copilot April 17, 2026 09:39
@github-actions github-actions Bot changed the title fix: Added all event types that the Python code handles fix: Added all event types that the Python code handles (SRV-214) Apr 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vsaltxx vsaltxx marked this pull request as ready for review April 17, 2026 09:46
@vsaltxx vsaltxx force-pushed the fix/close-issue-when-status-resolved branch from 11c35cf to 9ea4562 Compare April 17, 2026 11:23
…es (code-ql.yml, dangerjs.yml, pre-commit.yml, python-test.yml, sync-jira.yml)
@vsaltxx vsaltxx force-pushed the fix/close-issue-when-status-resolved branch from ebd4d00 to 389c3ca Compare April 17, 2026 13:04
@XDanielPaul
Copy link
Copy Markdown
Member

I looked through the code and it looks good to me, thank you

@XDanielPaul XDanielPaul self-requested a review April 17, 2026 14:42
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 30 days with no activity. Remove Status: Stale label or comment or this will be closed in 7 days.

@github-actions
Copy link
Copy Markdown

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions Bot closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants