mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 17:47:10 -06:00
Formalize PR process for breaking changes (#2289)
* Formalize PR process for breaking changes * Probably works.. right? * modular * now should work * Added get-pr-branch action * remove workflows * get-pr-branch.yml as workflow * moving things around * moving again * Add other tutorials * Revert "remove workflows" This reverts commit 7f3172a2884640e3f2024be99aea85aee4f00ada. * description * description * Revert "description" This reverts commit c04cb24eea3cde457be084a9f4c7af72c114643e.
This commit is contained in:
parent
c4041ab4ea
commit
1395f2a61c
10
.github/workflows/build-tutorial-hello-world.yml
vendored
10
.github/workflows/build-tutorial-hello-world.yml
vendored
@ -14,10 +14,18 @@ on:
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
|
||||
jobs:
|
||||
get-branch:
|
||||
name: "Get target branch"
|
||||
uses: ./.github/workflows/reusable-get-pr-branch.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-tutorial-hello-world
|
||||
|
||||
run:
|
||||
needs: get-branch
|
||||
name: ""
|
||||
uses: ./.github/workflows/reusable-builder.yml
|
||||
uses: ./.github/workflows/reusable-project-builder.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-tutorial-hello-world
|
||||
build_location: HelloWorldDeployment
|
||||
run_unit_tests: true
|
||||
target_ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
|
||||
10
.github/workflows/build-tutorial-led-blinker.yml
vendored
10
.github/workflows/build-tutorial-led-blinker.yml
vendored
@ -14,10 +14,18 @@ on:
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
|
||||
jobs:
|
||||
get-branch:
|
||||
name: "Get target branch"
|
||||
uses: ./.github/workflows/reusable-get-pr-branch.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-workshop-led-blinker
|
||||
|
||||
run:
|
||||
needs: get-branch
|
||||
name: ""
|
||||
uses: ./.github/workflows/reusable-builder.yml
|
||||
uses: ./.github/workflows/reusable-project-builder.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-workshop-led-blinker
|
||||
build_location: LedBlinker
|
||||
run_unit_tests: true
|
||||
target_ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
|
||||
10
.github/workflows/build-tutorial-math-comp.yml
vendored
10
.github/workflows/build-tutorial-math-comp.yml
vendored
@ -14,10 +14,18 @@ on:
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
|
||||
jobs:
|
||||
get-branch:
|
||||
name: "Get target branch"
|
||||
uses: ./.github/workflows/reusable-get-pr-branch.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-tutorial-math-component
|
||||
|
||||
run:
|
||||
needs: get-branch
|
||||
name: ""
|
||||
uses: ./.github/workflows/reusable-builder.yml
|
||||
uses: ./.github/workflows/reusable-project-builder.yml
|
||||
with:
|
||||
target_repository: fprime-community/fprime-tutorial-math-component
|
||||
build_location: MathDeployment
|
||||
run_unit_tests: true
|
||||
target_ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
|
||||
42
.github/workflows/reusable-get-pr-branch.yml
vendored
Normal file
42
.github/workflows/reusable-get-pr-branch.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# If the event that triggered this action is a PR and has a matching `pr-<number>` branch on
|
||||
# target_repository, then return the name of that branch. Otherwise, return default_target_ref.
|
||||
# See the CONTRIBUTING.md for info on why this is used.
|
||||
|
||||
name: 'Get PR Branch'
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
target_repository:
|
||||
description: 'The repository to check for the PR branch'
|
||||
type: string
|
||||
required: true
|
||||
default_target_ref:
|
||||
description: 'Ref to use if the PR branch is not found'
|
||||
type: string
|
||||
required: false
|
||||
default: devel
|
||||
outputs:
|
||||
target-branch:
|
||||
value: ${{ jobs.runs.outputs.target-branch }}
|
||||
|
||||
jobs:
|
||||
runs:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
target-branch: ${{ steps.get_target_branch.outputs.TARGET_BRANCH }}
|
||||
steps:
|
||||
- name: "Get target branch"
|
||||
id: get_target_branch
|
||||
run: |
|
||||
response_code=`curl -w '%{response_code}' https://api.github.com/repos/${{ inputs.target_repository }}/branches/pr-${{ github.event.number }} -o /dev/null`
|
||||
if [[ "${{ github.event_name }}" == "pull_request" && "$response_code" == "200" ]]; then
|
||||
echo "TARGET_BRANCH=pr-${{ github.event.number }}" >> $GITHUB_OUTPUT
|
||||
echo "PR branch found, using pr-${{ github.event.number }}"
|
||||
else
|
||||
echo "TARGET_BRANCH=${{ inputs.default_target_ref }}" >> $GITHUB_OUTPUT
|
||||
echo "PR branch not found, using ${{ inputs.default_target_ref }}"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@ on:
|
||||
default: "devel"
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ${{ inputs.runs_on }}
|
||||
name: "Build"
|
||||
@ -117,6 +117,15 @@ the end, these checks must pass for the submission to continue.
|
||||
If something seems amiss with one of these checks ask for help on your PR and a maintainer will do their best to help
|
||||
get the submission moving forward.
|
||||
|
||||
### Automated Checks on Reference Repositories
|
||||
|
||||
Some of the above-mentioned automated checks run on reference applications that are not part of the core F´ repository, such as our [tutorial repositories](https://github.com/fprime-community#tutorials). This serves two main purposes: running more tests, and making sure our suite of reference applications and tutorials do not go out-of-date.
|
||||
Because of this pattern, users who submit a pull request which introduces breaking changes on _how_ F´ is used in those external repositories will need to submit associated pull requests to introduce a fix on said external repositories.
|
||||
|
||||
The checks are configured to run on the `devel` branch of each external repository, but will prioritize the branch `pr-<PR_NUMBER>` if it exists, with `PR_NUMBER` being the number of the pull request that has been opened in nasa/fprime.
|
||||
|
||||
Maintainers will gladly help you in this process.
|
||||
|
||||
## Final Approval and Submission
|
||||
|
||||
Once all corrections have been made, automated checks are passing, and a maintainer has given final approval, it is time
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user