So you'd like to contribute to cFS? Below are some guidelines for contributors to follow. Contributions come in all shapes and sizes. We appreciate your help with documentation, unit tests, framework code, continuous-integration, or simply reporting bugs and improvement ideas. We can't promise that we'll accept every suggestion or fix every bug in a timely manner but at the very least we'll respond to you.
This project and everyone participating in it is governed by the cFS Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the product team.
For questions or help, submit a GitHub issue, join the cfs community mailing list.
- Perform a cursory search to see if the bug has already been reported. For issues in each submodule, visit the section Quick Links to Submodules. If a bug has been reported and the issue is still open, add a comment to the existing issue instead of opening a new one.
- Determine which repository the bug should be reported in. If you are not sure, place the issue in NASA/cFS.
If you run into a bug with the project:
- Open an issue using the bug report template.
- Describe the issue.
- Describe the expected behavior if the bug did not occur.
- Provide the reproduction steps that someone else can follow to recreate the bug or error on their own.
- If applicable, add code snippets or references to the software.
- Provide the system the bug was observed on including the hardware, operating system, and versions.
- Provide any additional context if applicable.
- Provide your full name or GitHub username and your company organization if applicable.
- The project team will label the issue.
- A team member will try to reproduce the issue with your provided steps. If the team is able to reproduce the issue, the issue will be left to be implemented by someone.
- Review the cFS README.md file to see if your feature is in the major future work.
- Perform a cursory search to see if the feature has already been requested. For issues in each submodule, visit the section Quick Links to Submodules. If a feature request has been reported and the issue is still open, add a comment to the existing issue instead of opening a new one.
- Determine which repository the feature should be reported in. If you are not sure, place the issue in NASA/cFS.
- Open an issue using the feature request template.
- Describe the feature.
- Describe the solution you would like.
- Describe alternatives you've considered.
- Provide any additional context if applicable.
- Provide your full name or GitHub username and your company organization if applicable.
- The project team will label the issue.
- The project team will evaluate the feature request, possibly asking you more questions to understand its purpose and any relevant requirements. If the issue is closed, the team will convey their reasoning and suggest an alternative path forward.
- If the feature request is accepted, it will be marked for implementation.
Please view our Security Policy for more information.
Follow GitHub's fork-branch-pull request pattern.
- Fork the relevant cFS component (eg. cfe, osal, psp).
- Create a new branch in your fork to work on your fix. We recommend naming your branch
fix-ISSUE_NUMBER-<FIX_SUMMARY>
. - Submit a pull request to the nasa
main
branch. We recommend creating your pull-request as a "draft" and to commit early and often so the community can give you feedback at the beginning of the process as opposed to asking you to change hours of hard work at the end. - Add commits to your branch. For information on commit messages, review How to Write a Git Commit Message. Please follow commit message convention:
Fix #XYZ, SHORT_DESCRIPTION
LONG_DESCRIPTION (optional)
- Sign and email the appropriate Contributor License agreement down below to [email protected] and copy [email protected].
- Corporate Contributor License agreement : https://github.com/nasa/cFE/blob/main/docs/GSC_18128_Corp_CLA_form_1219.pdf
- Individual Contributor License agreement : https://github.com/nasa/cFE/blob/main/docs/GSC_18128_Ind_CLA_form_1219.pdf
- For the title, use the title convention
Fix #XYZ, SHORT_DESCRIPTION
. - Describe the contribution. First document which issue number was fixed using the template "Fix #XYZ". Then describe the contribution.
- Provide what testing was used to confirm the pull request resolves the link issue.
- Provide the expected behavior changes of the pull request.
- Provide the system the bug was observed on including the hardware, operating system, and versions.
- Provide any additional context if applicable.
- Provide your full name or GitHub username and your company or organization if applicable.
- Verify the commit message and PR title uses the template
Fix #XYZ, SHORT_DESCRIPTION
. For information on commit messages, review How to Write a Git Commit Message. The commit message may use the template:
Fix #XYZ, SHORT_DESCRIPTION
LONG_DESCRIPTION (optional)
- Verify there is one commit message per topic. For example, review the provided pull request.
- Squash or amend the commit messages if necessary. For more information, review the sections How to Squash Commits and How to Amend Commits .
- Verify that the PR passes all checks.
- The project team will label the issue and evaluate the pull request in the weekly configuration control board (CCB) meeting. For more information, visit The cFS CCB Process.
- If the pull request is accepted, it will be merged into cFS.
- Switch to the main branch and ensure you are up to date:
git checkout main && git pull
- Checkout your feature branch:
git merge feature_branch
- Use rebase to open the vi or other editor that lists the commits:
git rebase main -i
- A text editor will open with a file that lists all the commits in your branch, and in front of each commit is the word "pick". It looks something like this:
pick 1fc6c95 do something
pick 6b2481b do something else
pick dd1475d changed some things
pick c619268 fixing typos
- For every line except the first, you want to replace the word "pick" with the word "squash" or with "f". "squash" merges the commit into previous commit. "f" is like "squash", but discard this commit's log message. So, if you wish to skip the step where you have to update the commit message then use "f". To edit the first commit message, replace "pick" with "r". For example, it should look like this:
pick 1fc6c95 do something
squash 6b2481b do something else
squash dd1475d changed some things
squash c619268 fixing typos
or
r 1fc6c95 do something
f 6b2481b do something else
f dd1475d changed some things
f c619268 fixing typos
-
Save and close the file. If you used "pick" and "squash", a new file should pop up in your editor, combining all the commit messages of all the commits. Reword this commit message as you want, and then save and close that file as well.
-
Push the commit:
git push --force
Use the "soft" method with caution. Ensure that you reset back to the original baseline. If you have switched branches and pulled from the remote since starting the branch originally, you may inadvertently overwrite other changes.
- To tell Git to reset HEAD to another commit, so index and the working directory will not be altered in any way use a soft reset. All of the files changed between the original HEAD and the commit will be staged. To use a soft reset:
git reset --soft main
- Add all changes:
git add -A
- Add a commit message:
git commit -m "Fix #XYZ, SHORT_DESCRIPTION
LONG_DESCRIPTION (optional)"
- Push the commit:
git push --force
This method had no chances of inadvertently overwriting other stuff.
- Make a new branch with a new name at the current main:
git checkout -b "fix-ISSUE_NUMBER-<FIX_SUMMARY>".
- Merge:
git merge --squash ${old_branch}
- Test the result, then commit to write a new commit message summarizing the full change:
git commit
- Rename your new branch over your old branch to replace it:
git branch -m -f ${new_branch} ${old_branch}
- Push to GitHub:
git push --force
- To modify your last commit message:
git commit --amend
- The previous commit message will load an editor session, where you can make changes to the message, save those changes and exit. When you save and close the editor, the editor writes a new commit containing that updated commit message and makes it your new last commit. Push the new changes:
git push --force
- To change the actual content of your last commit, stage those changes:
git add <file>
- Amend the commit:
git commit --amend
- Now the last commit is replaced by your new and improved commit. Push the commit:
git push --force
-
Follow cFS code conventions (formatting, symbol naming, file naming, etc). Do not change/reformat existing code, except to address your changes.
- The cFS submodules uses the Format Check workflow to ensure users follow the clang-format-10 style. For more information on how to use the Format Check workflow, view Using GitHub Actions Workflows.
- The cFS_IdentifierNamingConvention document provides a simple naming convention guide for cFE/cFS for commands and telemetry that simplifies the EDS to ground telemetry and commands database conversion.
- The cFE Application Developers Guide contains code conventions such as naming conventions for header files.
-
For any new API's, add unit tests to cover nominal and off-nominal conditions.
-
Add/edit stubs to the unit test codebase for any new/modified functions.
-
For any changes to existing API's, alter the unit tests to cover the changes (and remove tests made irrelevant due to your changes).
-
Review the static code analyses results from the Static Analysis and CodeQL Analysis workflows. For more information on how to use these workflows, view Using GitHub Actions Workflows.
- Push code changes to the appropriate forked repository.
- Go to the Actions tab and enable GitHub Actions Workflow. The CodeQL Analyis and Static Analysis will be triggered for all pushed code.
- Review these workflows for any warnings or errors.
- Once successful, create a pull request.
Several of our GitHub Actions Workflows are used to ensure pushed code and pull requests do not break cFS, create vulnerabilities, and follow our code conventions. Other workflows are used for documentation purposes.
Most of the workflows in the NASA/cFS repository will run for all branches when code is pushed and a pull request is created, except for the changelog workflow that runs manually.
All of our workflows will be available for forked repositories once enabled. To enable workflows, navigate to the Actions tab and click "I understand my workflows, go ahead and enable them".
- Navigate to Actions in the selected repository. For newly forked repositories, enable workflows after clicking on Actions.
- In the left sidebar, click the workflow you want to view.
- From the list of workflow runs, click the name of the run you want to see.
- Under Jobs or in the visualization graph, click the failed job.
- Any failed steps are automatically expanded to display the results.
- Navigate to Actions in the selected repository. For newly forked repositories, enable workflows after clicking on Actions.
- In the left sidebar, click the workflow you want to view.
- From the list of workflow runs, click the name of the run you want to see.
- Scroll to the bottom of the page and download the artifacts. For CodeQL results, navigate to the Security Tab and click Code scanning alerts. CodeQL results will only be avaiable on your forked repository.
or
- In pull requests, click the Checks tab.
- From the list of workflow runs, click the name of the run you want to see.
- Scroll to the bottom of the page and download the artifacts. For CodeQL results, expand Code scanning alerts at the bottom of the list of checks and select CodeQL.
- Workflows are under .github/workflows.
- Configure the files as needed. For more information on how to configure GitHub Actions, visit Workflow syntax for GitHub Actions.
Information on our GitHub Action Workflows can be found in the .github/workflows README.md document.
Before you report bugs or submit feature requests, search through the open issues in each submodule to ensure that your ticket is relevant, not redundant, nor in conflict with other tickets:
If your bug or feature hasn't been reported or requested before, create a new issue in the appropriate repository. If it you find a similar issue, please add a comment on it with your experience or input.
Please ensure that your name is associated with your github profile before contributing.