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

Add a workflow to open a PR to the next stage when the stage of an RFC has been updated #844

Merged
merged 12 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/advance-to-ready-for-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Advance #__RFC_NUMBER__ to the [Ready For Release Stage](https://github.com/emberjs/rfcs#ready-for-release)

## Summary

This pull request is advancing the RFC to the [Ready For Release Stage](https://github.com/emberjs/rfcs#ready-for-release).

- PR to Accepted Stage: #__RFC_NUMBER__

**An FCP is required before merging this PR to advance.**

Upon merging this PR, automation will open a draft PR for this RFC to move to the [Released Stage](https://github.com/emberjs/rfcs#released).

<details>
<summary>Ready for Release Stage Description</summary>

This stage is complete when the implementation is complete according to plan outlined in the RFC, and is in harmony with any changes in Ember that have occurred since the RFC was first written. This includes any necessary learning materials. At this stage, features or deprecations may be available for use behind a feature flag, or with an optional package, etc.

For codebase changes, there are no open questions that are anticipated to require breaking changes; the Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature.

This stage should include a list of criteria for determining when the proposal can be considered Recommended after being Released.

An FCP is required to move into this stage.

Each Ember core team will be requested as a reviewer on the PR to move into this stage. A representative of each team adds a review. If a team does not respond to the request, and after the conclusion of the FCP, it is assumed that the release may proceed.
</details>

## Checklist to move to Ready for Release

- [ ] Implementation is complete according to plan outlined in the RFC, with any adjustments noted in the RFC
- [ ] Any necessary learning materials have been updated
- [ ] The Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature
- [ ] Criteria for moving to the Recommended Stage has been filled out
- [ ] This PR has been converted from a draft to a regular PR and the `Final Comment Period` label has been added to start the FCP
- [ ] Each [team](https://github.com/emberjs/rfcs#relevant-teams) has been added as a reviewer to the PR at the start of the FCP
* [ ] Framework @emberjs/framework
* [ ] Data @emberjs/ember-data-core
* [ ] CLI @emberjs/cli
* [ ] Learning @emberjs/learning-core
* [ ] Typescript @emberjs/typescript-core
* [ ] Steering @emberjs/steering


## Criteria for moving to Recommended (required)

A set of criteria for moving this RFC to the Recommended Stage, following release:

1.
2.

## Track Implementation

<-- Use this section to track implementation of the RFC -->
53 changes: 53 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/advance-to-recommended.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Advance #__RFC_NUMBER__ to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended)

## Summary

This pull request is advancing the RFC to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended).

- PR to Accepted Stage: #__RFC_NUMBER__
- [PR to Ready For Release Stage](__READY_FOR_RELEASE_PR__)
- [PR to Released Stage](__RELEASED_PR__)

**An FCP is required before merging this PR to advance.**


<details>
<summary>Recommended Stage Summary</summary>

The "Recommended" stage is the final milestone for an RFC. It provides a signal to the wider community to indicate that a feature has been put through its ecosystem paces and is ready to use.

To reach the "Recommended" stage, the following should be true:

If appropriate, the feature is integrated into the tutorial and the guides prose. API documentation is polished and updates are carried through to other areas of API docs that may not directly pertain to the feature.

If the proposal replaces an existing feature, the addon ecosystem has largely updated to work with both old and new features.

If the proposal updates or replaces an existing feature, high-quality codemods are available.

If needed, Ember debugging tools as well as popular IDE support have been updated to support the feature.

If the feature is part of a suite of features that were designed to work together for best ergonomics, the other features are also ready to be "Recommended".

Any criteria for "Recommended" for this proposal that were established in the Ready For Release stage have been met.

An FCP is required to enter this stage. Multiple RFCs may be moved as a batch into "Recommended" with the same PR.
</details>

## Checklist to move to Recommended

- [ ] Any criteria for "Recommended" for this proposal that were established in the Ready For Release stage have been met
- [ ] If appropriate, the feature is integrated into the tutorial and the guides prose. API documentation is polished and updates are carried through to other areas of API docs that may not directly pertain to the feature.
- [ ] If the proposal replaces an existing feature, the addon ecosystem has largely updated to work with both old and new features.
- [ ] If the proposal updates or replaces an existing feature, high-quality codemods are available
- [ ] If needed, Ember debugging tools as well as popular IDE support have been updated to support the feature.
- [ ] If the feature is part of a suite of features that were designed to work together for best ergonomics, the other features are also ready to be "Recommended".
- [ ] This PR has been converted from a draft to a regular PR and the `Final Comment Period` label has been added to start the FCP

## Criteria for moving to Recommended (required)

<-- Copy and paste the criteria for "Recommended" from the Ready For Release stage here -->

A set of criteria for moving this RFC to the Recommended Stage, following release:

1.
2.
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/advance-to-released.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Advance #__RFC_NUMBER__ to the [Released Stage](https://github.com/emberjs/rfcs#released)

## Summary

This pull request is advancing the RFC to the [Released Stage](https://github.com/emberjs/rfcs#released).

- PR to Accepted Stage: #__RFC_NUMBER__
- [PR to Ready For Release Stage](__READY_FOR_RELEASE_PR__)

Upon merging this PR, automation will open a draft PR for this RFC to move to the [Recommended Stage](https://github.com/emberjs/rfcs#recommended).

<details>
<summary>Released Stage Summary</summary>

The work is published. If it is codebase-related work, it is in a stable version of the relevant package(s). If there are any critical deviations from the original RFC, they are briefly noted at the top of the RFC.

If the work for an RFC is spread across multiple releases of Ember or other packages, the RFC is considered to be in the Released stage when all features are available in stable releases and those packages and versions are noted in the RFC frontmatter.

Ember's RFC process can be used for process and work plans that are not about code. Some examples include Roadmap RFCs, changes to the RFC process itself, and changes to learning resources. When such an RFC is a candidate for Released, the work should be shipped as described, and the result should presented to the team with the intent of gathering feedback about whether anything is missing. If there is agreement that the work is complete, the RFC may be marked "Released" and a date is provided instead of a version.

An RFC is moved into "Released" when the above is verified by consensus of the relevant team(s) via a PR to update the stage.
</details>

## Checklist to move to Released

- [ ] The work is published in stable versions of the relevant package(s)
- [ ] Deviations from the original RFC are noted in the RFC
- [ ] Release packages and dates are updated in the RFC frontmatter
118 changes: 118 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# emberjs/rfcs automation

## Workflows

### newly-added-rfc.yml

This workflow runs on pull requests. The jobs gate on the first job which determines
if the pull request adds a new RFC.

This has various checks to ensure new the RFC has correct metadata, filename, etc.

This should be tested when updating actions/find-added-or-modified-rfcs or any of
the actions used within that action. See [testing](#testing).

Test the following:
- [ ] Adding a new RFC. A new pull request should be opened with a new RFC, the
first job should correctly determine that an RFC has been added and the other
jobs should run.
- [ ] Modifying an RFC. A new pull request that modifies an existing RFC, the
first job should correctly determine that an RFC has not been added and the other
jobs should not run.

### ci.yml

This workflow runs on all pull requests and pushes to the primary branch. It
lints the frontmatter of all RFCs in the repository.

### label-opened-new-rfc-prs.yml

This workflow runs on pull requests. The jobs gate on the first job which determines
whether the pull request adds a new RFC. If it does, it labels the pull request with
'S-Proposed' as it is a newly proposed RFC.

This should be tested when updating actions/find-added-or-modified-rfcs or any of
the actions used within that action. See [testing](#testing).

Test the following:
- [ ] Adding a new RFC. A new pull request should be opened with a new RFC, the
first job should correctly determine that an RFC has been added and the other
jobs should run. The label `S-Proposed` should be added.
- [ ] Modifying an RFC. A new pull request that modifies an existing RFC, the
first job should correctly determine that an RFC has not been added and the other
jobs should not run. No label should be added.

### advance-rfc.yml

This workflow runs on pushes to the primary branch. The jobs gate on the first job
which determines if the push added an RFC or modified the stage of a previously-merged
RFC.

Due to constraints in determining RFCs that have been modified, this workflow will
fail if the push modifies more than one RFC. If the push didn't modify the stage
of any of the modified RFCs, this can be completely okay.

If an RFC stage was modified, this triggers the open-advancement-pr.yml workflow.

This should be tested when updating actions/find-added-or-modified-rfcs or any of
the actions used within that action. See [testing](#testing).

Test the following:
- [ ] Adding a new RFC. Merging a pull request that adds an RFC should open a
pull request to advance to the next stage using the correct template.
- [ ] Updating an RFC stage. Merging a pull request that modifies an existing RFC's
stage to something other than the last stage should open a pull request to
advance to the next stage using the correct template.
- [ ] Updating an RFC stage to the last stage. Merging a pull request that modifies
an existing RFC's stage to the final stage should NOT open a pull request.
- [ ] Modifying an RFC in any way that is not updating the stage. Merging a pull
request that does this should NOT open a pull request.

### trigger-opening-advancement-pr.yml

This workflow runs on workflow_dispatch and can be triggered from the GitHub UI.
It takes a path to an RFC and will open a PR to advance it to the next stage, if
applicable.

Test the following:
- [ ] In the UI, on this workflow, trigger with a path of an existing RFC. A pull
request should be opened to advance the RFC to the next stage.
- [ ] In the UI, on this workflow, trigger with a path of an existing RFC at the
final stage. A pull request should NOT be opened.

### open-advancement-pr.yml

This workflow is used by the advance-rfc.yml workflow to open a pull request to
advance to the next stage. It is also used by the trigger-opening-advancement-pr.yml
workflow.

This also generates an artifact named `advancement-prs` with files named `advance-rfc-XYX.json`.
There should be at most one file per RFC. The file contains the latest PR to
advance that RFC, along with other metadata.

## generate-rfc-frontmatter-json.yml

This workflow runs on pushes to the primary branch. It generates a JSON file with
all RFC frontmatter and is uploaded to an artifact named `rfc-data`.

## Actions

### find-added-or-modified-rfcs

Gathers info about RFCs that have been added or modified in a pull request or push
(depending on inputs passed).

### setup-rfcs-tooling

Reusable action to checkout the rfcs-tooling repo and set it up for use.

## PULL_REQUEST_TEMPLATE

Directory of templates for use in opening stage advancement pull requests.

## Testing
[Testing]: #testing

Testing is primarily done by copying these actions and workflows to a test
repository and running the workflows
(see [kategengler/playground-ghs](https://github.com/kategengler/playground-ghas)).
51 changes: 51 additions & 0 deletions .github/actions/find-added-or-modified-rfcs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Find added or modified RFCs
description: 'Find added or modified RFC'

# Any workflow using this action requires using actions/checkout with a fetch-depth: 0

inputs:
base-sha:
description: 'Base SHA'
required: false
sha:
description: 'SHA'
required: false

outputs:
modified-rfc:
description: "The path of the RFC that was added or modified"
value: ${{ steps.modified-rfc.outputs.path }}
modified-rfcs-count:
description: "The count of how many RFCs were added or modified"
value: ${{ steps.counts.outputs.all_changed }}
added-rfcs-count:
description: "The count of how many RFCs that were added"
value: ${{ steps.counts.outputs.added }}

runs:
using: "composite"
steps:
- name: Find added or modified RFCs
id: rfcs
uses: tj-actions/changed-files@v31
with:
path: 'text'
json: 'true'
sha: ${{ inputs.sha }}
base_sha: ${{ inputs.base-sha }}

- name: Get counts of changed and added RFCs
id: counts
shell: bash
run: |
changed_len=`echo "${{ steps.rfcs.outputs.all_changed_files }}" | jq '. | length'`
echo "all_changed=$changed_len" >> $GITHUB_OUTPUT
added_len=`echo "${{ steps.rfcs.outputs.added_files }}" | jq '. | length'`
echo "added=$added_len" >> $GITHUB_OUTPUT

- name: Find modified or added RFC info
id: modified-rfc
shell: bash
run: |
changed_file=`echo "${{ steps.rfcs.outputs.all_changed_files }}" | jq '.[0]'`
echo "path=$changed_file" >> $GITHUB_OUTPUT
20 changes: 20 additions & 0 deletions .github/actions/setup-rfcs-tooling/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup RFCs Tooling
description: 'Setup RFCs Tooling'

runs:
using: "composite"
steps:
- name: Checkout tools repo
uses: actions/checkout@v3
with:
repository: emberjs/rfcs-tooling
path: rfcs-tooling
ref: 'v2.1.0'

- uses: actions/setup-node@v3
with:
node-version: 16

- run: yarn install
shell: bash
working-directory: rfcs-tooling
Loading