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 #62, Implement Coding Standard CodeQL #63

Conversation

ArielSAdamsNASA
Copy link

Describe the contribution
Fix #62
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 PR or Issue is ready for discussion at the Configuration Control Board (CCB) continuous-integration labels May 21, 2021
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-62-implement-coding-standard-codeql branch 2 times, most recently from b65731e to c975c18 Compare May 26, 2021 13:53
@ArielSAdamsNASA ArielSAdamsNASA force-pushed the fix-62-implement-coding-standard-codeql branch from c975c18 to 5acb286 Compare May 26, 2021 20:30
@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 PR or Issue is ready for discussion at the Configuration Control Board (CCB) label Jun 2, 2021
@astrogeco astrogeco changed the base branch from main to integration-candidate June 10, 2021 18:09
@astrogeco astrogeco added the CCB:Approved Indicates code review and approval by community CCB label Jun 10, 2021
@astrogeco astrogeco merged commit da3ae33 into nasa:integration-candidate Jun 10, 2021
astrogeco added a commit to nasa/cFS that referenced this pull request Jun 10, 2021
*Documentation Updates:*

nasa/cFE#1598, Updated FS Read/WriteHeader API return documentation
nasa/cFE#1601, Document CFE_ES_RunLoop increment task counter behavior
nasa/cFE#1602, Document CFE_TBL_Unregister use-case
nasa/cFE#1603, Update version description per current design

*Standardize docs generation:*

nasa/cFE#1615, standardize on "docs" subdirectory
nasa/osal#1071, rename doc to docs
nasa/PSP#294, rename doc to docs

*Implement Coding Standard:*

nasa/ci_lab#87
nasa/sample_app#149
nasa/sample_lib#63
nasa/sch_lab#79
nasa/to_lab#98
nasa/cFS-GroundSystem#180
nasa/elf2cfetbl#80
nasa/tblCRCTool#48
nasa/osal#1042
nasa/PSP#292
@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 <skliper@users.noreply.github.com>
Co-authored-by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored-by: Ariel Adams <ArielSAdamsNASA@users.noreply.github.com>
Co-authored-by: Alex Campbell <zanzaben@users.noreply.github.com>
Co-authored-by: Jose F Martinez Pedraza <pepepr08@users.noreply.github.com>
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.

Implement Coding Standard Rules in CodeQ
4 participants