Skip to content
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 #264, CodeQL Dependent on a Successful Build #304

Conversation

ArielSAdamsNASA
Copy link
Contributor

@ArielSAdamsNASA ArielSAdamsNASA commented Jul 16, 2021

Checklist (Please check before submitting)

Describe the contribution
Fixes #264
Added workflow_run event as a trigger.

Testing performed
Tested on fork. Triggered on workflow_run. Will work once workflow is integrated in main.
image

Expected behavior changes
If Build, Test, and Run [OMIT_DEPRECATED=true] fails, then CodeQL will not run.

Additional context
https://stackoverflow.com/questions/62750603/github-actions-trigger-another-action-after-one-action-is-completed
Build, Test, and Run [OMIT_DEPRECATED=true] must be renamed.

Tried

    workflows: 
      - 'Build, Test, and Run [OMIT_DEPRECATED=true]'
    workflows: 
      - Build, Test, and Run [OMIT_DEPRECATED=true]
    workflows: ["Build, Test, and Run [OMIT_DEPRECATED=true]"]

Build, Test, and Run name works.

Downside is that CodeQL workflow does not name what triggered the workflow such as the name of the commit. Instead it always says the name of the workflow which is CodeQL Analysis.

Contributor Info - All information REQUIRED for consideration of pull request
Ariel Adams, ASRC Federal

@ArielSAdamsNASA ArielSAdamsNASA added CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) continuous-integration labels Jul 16, 2021
@astrogeco astrogeco changed the title Fix #264 CodeQL Sependent on a Successful Build Fix #264 CodeQL Dependent on a Successful Build Jul 16, 2021
@astrogeco
Copy link
Contributor

I wonder if we can skip the tests altogether. Also, look into making the CodeQL workflow dependent on the "build and run" one https://github.com/marketplace/actions/workflow-run-conclusion-dispatch-action

@ArielSAdamsNASA
Copy link
Contributor Author

@astrogeco Can you specify what you mean by the build and run one? Like the workflow or a job?

@ArielSAdamsNASA ArielSAdamsNASA removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Jul 16, 2021
@astrogeco
Copy link
Contributor

@astrogeco Can you specify what you mean by the build and run one? Like the workflow or a job?

Sorry, meant the build and run workflow

@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-264-CodeQL-dependent-on-successful-build branch from 3c9db50 to a003af2 Compare July 16, 2021 15:55
@ArielSAdamsNASA
Copy link
Contributor Author

@astrogeco Can you specify what you mean by the build and run one? Like the workflow or a job?

Sorry, meant the build and run workflow

So, build-cfs-deprecated.yml or build-cfs.yml?

I feel like it would be best to just build and run cFS in jobs.

I don't quite understand the action you provided and the workflow_run trigger isn't working.

https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run

This event will only trigger a workflow run if the workflow file is on the default branch.

@astrogeco
Copy link
Contributor

The idea was to wait for the build and test workflow defined in build-cfs.yml to successfully execute and avoid building cFS multiple times in different workflows. It might not be worth the complexity though.

@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-264-CodeQL-dependent-on-successful-build branch 4 times, most recently from 75ee066 to 5724e49 Compare July 19, 2021 18:10
@ArielSAdamsNASA ArielSAdamsNASA added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Jul 19, 2021
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-264-CodeQL-dependent-on-successful-build branch from 5724e49 to 7c04605 Compare July 19, 2021 18:22
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'


jobs:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure this won't run twice without the check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CodeQL is only triggered on workflow_run, but I can keep the check there for now.

.github/workflows/codeql-build.yml Outdated Show resolved Hide resolved
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-264-CodeQL-dependent-on-successful-build branch 3 times, most recently from 2649a44 to 41f6b61 Compare July 20, 2021 15:53
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-264-CodeQL-dependent-on-successful-build branch from 41f6b61 to a146436 Compare July 20, 2021 15:54
@astrogeco astrogeco changed the title Fix #264 CodeQL Dependent on a Successful Build Fix #264, CodeQL Dependent on a Successful Build Jul 21, 2021
@astrogeco astrogeco added CCB:Approved Indicates code review and approval by community CCB and removed CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) labels Jul 21, 2021
@astrogeco
Copy link
Contributor

CCB:2021-07-21 APPROVED

@astrogeco astrogeco changed the base branch from main to integration-candidate July 21, 2021 18:13
@astrogeco astrogeco merged commit da741e1 into nasa:integration-candidate Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code review and approval by community CCB continuous-integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make CodeQL workflow dependent on a succesful build
3 participants