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 #98, Implement Coding Standard in CodeQL #99

Conversation

ArielSAdamsNASA
Copy link

Describe the contribution
Fix #98
Added the duplicate jobs action to avoid duplicate jobs from running. Added a separate job for coding standard queries. Created two configuration files, one for default queries and security queries and another for jpl rules. Removed push on main branch so when users push code to their forked repos, the workflow runs. Added main branch to pull request, so CodeQL runs on pull request made in the main branch. This is the same logic used in the cFS bundle repo.

Testing performed
Testing done on cFE forked repository, ArielSAdamsNASA/cFE which used the same files, but with different configuration paths.

Jobs were failing when the entire path of the configuration file were not used. Have to use nasa/cFE/.github/codeql/config-name@branch-name. The branch must be included in the path.

The CodeQL analysis workflow will fail for this PR since it is calling for a configuration file in main the main branch. It will not work until the configuration files are merged into main.

In the screenshot is the same workflow as in this pull request, but the configuration path is changed to the forked repo and tested branch.

image

Expected behavior changes
There should be one job for security queries and one job for JPL and MISRA queries.

Describe alternatives you've considered
Can allow all branches to run CodeQL for pull requests as seen in cFE and PSP instead of just the main branch like cFS.

Third party code
Skip duplicate workflows license: https://github.com/fkirc/skip-duplicate-actions/blob/master/LICENSE

CodeQL license: https://github.com/github/codeql-action/blob/main/LICENSE

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 May 21, 2021
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-98-implement-coding-standard-codeql branch 3 times, most recently from 0cf41ad to f8635c5 Compare May 26, 2021 13:48
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-98-implement-coding-standard-codeql branch from f8635c5 to a164671 Compare May 26, 2021 20:37
@ArielSAdamsNASA
Copy link
Author

Removed configuration files and used cFS configuration files instead. CodeQL workflow is not successful.

Error "The configuration file "nasa/cFS/.github/codeql/codeql-coding-standard.yml@main" is invalid: property "queries.uses" is invalid as the local path "codeql/cpp/ql/src/JPL_C" does not exist in the repository".

Tested locally, error goes away when full path of queries are used in cFS/.github/codeql/codeql-coding-standard.yml. For example, instead of ./codeql/cpp/ql/src/JPL_C use github/codeql/cpp/ql/src/JPL_C@main. Some repositories such as cFE does not require the full path.

Created PR for cFS to resolve this issue: nasa/cFS#262

@astrogeco astrogeco removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Jun 3, 2021
@astrogeco astrogeco changed the base branch from main to integration-candidate June 10, 2021 18:06
@astrogeco astrogeco added the CCB:Approved Indicates approval by CCB label Jun 10, 2021
@astrogeco astrogeco merged commit 3d94ca6 into nasa:integration-candidate Jun 10, 2021
@skliper
Copy link
Contributor

skliper commented Jun 23, 2021

@astrogeco - Not in main, status?

astrogeco added a commit to nasa/cFS that referenced this pull request Jun 24, 2021
*Combines*

- nasa/elf2cfetbl#81
- nasa/tblCRCTool#52
- nasa/ci_lab#88
- nasa/sch_lab#83
- nasa/sample_app#150
- nasa/sample_lib#64
- nasa/to_lab#100

*Includes*

- nasa/cFE#1630, correct path to users guide warning log
- nasa/cFE#1621, add additional test cases for Child Tasks
- nasa/cFE#1608, Add cfe functional tests to CI
- nasa/cFE#1627, rename/clean CFE coverage assert macros
- nasa/cFE#1623, Added UT tests for cFE ES Api
- nasa/cFE#1634, Expand CDS Functional Tests.
- nasa/cFE#1633, add test log file
- nasa/cFE#1594, Event ID updates
- nasa/cFE#1624, scrub all UT_Report calls

- nasa/osal#1066, implement missing parameter/retcode test permutations

- nasa/cFS-GroundSystem#182, Add test start command script for cmdUtil
- nasa/tblCRCTool#51, add printf conversion casts

** Implement Coding Standard in CodeQL **

- nasa/cFS-GroundSystem#180
- nasa/elf2cfetbl#80
- nasa/tblCRCTool#49

- nasa/ci_lab#87
- nasa/sch_lab#79
- nasa/sample_app#149
- nasa/sample_lib#63
- nasa/to_lab#99
astrogeco added a commit to nasa/cFS that referenced this pull request Jun 24, 2021
*Combines*

- nasa/cFE#1632, v6.8.0-rc1+dev726
- nasa/osal#1079, v5.1.0-rc1+dev548

- nasa/ci_lab#88, v2.4.0-rc1+dev42
- nasa/sch_lab#83, v2.4.0-rc1+dev40
- nasa/sample_app#150, v1.2.0-rc1+dev66
- nasa/sample_lib#64, v1.2.0-rc1+dev38
- nasa/to_lab#100, v2.4.0-rc1+dev49

- nasa/elf2cfetbl#81, v3.2.0-rc1+dev30
- nasa/tblCRCTool#52, v1.2.0-rc1+dev33
- nasa/cFS-GroundSystem#183, v2.2.0-rc1+dev52

*Includes*

- nasa/cFE#1630, correct path to users guide warning log
- nasa/cFE#1621, add additional test cases for Child Tasks
- nasa/cFE#1608, Add cfe functional tests to CI
- nasa/cFE#1627, rename/clean CFE coverage assert macros
- nasa/cFE#1623, Added UT tests for cFE ES Api
- nasa/cFE#1634, Expand CDS Functional Tests.
- nasa/cFE#1633, add test log file
- nasa/cFE#1594, Event ID updates
- nasa/cFE#1624, scrub all UT_Report calls

- nasa/osal#1066, implement missing parameter/retcode test permutations

- nasa/cFS-GroundSystem#182, Add test start command script for cmdUtil
- nasa/tblCRCTool#51, add printf conversion casts

** Implement Coding Standard in CodeQL **

- nasa/cFS-GroundSystem#180
- nasa/elf2cfetbl#80
- nasa/tblCRCTool#49

- nasa/ci_lab#87
- nasa/sch_lab#79
- nasa/sample_app#149
- nasa/sample_lib#63
- nasa/to_lab#99

Co-authored-by: Jacob Hageman <[email protected]>
Co-authored-by: Joseph Hickey <[email protected]>
Co-authored-by: Ariel Adams <[email protected]>
Co-authored-by: Alex Campbell <[email protected]>
Co-authored-by: Jose F Martinez Pedraza <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Coding Standard Rules in CodeQL
4 participants