Skip to content

Remove explicit pull request event types from workflow#1288

Merged
rdmark merged 1 commit intodevelopfrom
rdmark-revert-push-rule
Nov 3, 2023
Merged

Remove explicit pull request event types from workflow#1288
rdmark merged 1 commit intodevelopfrom
rdmark-revert-push-rule

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Nov 2, 2023

According to github docs, when not specifying pull request event type in the github workflow, the default events are "opened, synchronize, and reopened". However, the way we explicitly defined the event types caused the "synchronize" event (run the jobs when new commit is synchronized with the remote branch) to not trigger. Removing the explicitly defined events and using the default gets us the wanted behavior (e.g. triggering workflows on new commits to a PR branch.)

@rdmark rdmark force-pushed the rdmark-revert-push-rule branch from e22544e to b0d80c6 Compare November 2, 2023 22:55
@rdmark rdmark changed the title Test push rules Remove workflow rules that caused incorrect behavior Nov 2, 2023
@rdmark rdmark force-pushed the rdmark-revert-push-rule branch from 18b40b7 to b0d80c6 Compare November 2, 2023 23:20
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Nov 2, 2023

We seem to have been using the wrong syntax for events. The documentation suggests the array syntax for the list of event types. I tested this syntax:

  pull_request:
    paths:
      - 'cpp/**'
      - 'python/**'
      - '.github/workflows/cpp.yml'
    types: [assigned, opened, reopened, synchronize]

However this resulted in the duplicate sets of jobs, again. I'm not sure if this is expected, or a bug in github workflows.

@rdmark rdmark requested a review from uweseimet November 2, 2023 23:24
@rdmark rdmark changed the title Remove workflow rules that caused incorrect behavior Remove explicit pull request type from workflow Nov 2, 2023
@rdmark rdmark changed the title Remove explicit pull request type from workflow Remove explicit pull request event types from workflow Nov 2, 2023
@rdmark rdmark force-pushed the rdmark-revert-push-rule branch from bbb2882 to c2813c5 Compare November 3, 2023 00:00
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Nov 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Thank you for analyzing this.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Nov 3, 2023

@uweseimet You're welcome. Let me know if this works correctly for your workflow as well. I tested that subsequent changes to C++ or Python code triggered the jobs that I expected.

@rdmark rdmark merged commit d1a080b into develop Nov 3, 2023
@rdmark rdmark deleted the rdmark-revert-push-rule branch November 3, 2023 07:54
@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark I'm afraid there is no change. I just committed d1a080b and the anaylsis was not started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants