Skip to content

Commit

Permalink
Change management of unreleased section of CHANGELOG (#2723)
Browse files Browse the repository at this point in the history
## Linked Issues/PRs
#2658

## Description
This PR implements the new way of handling the unreleased section of the
changelog in order to avoid conflicts on each PR merge. Details are
available here : #2658.

Main changes : 

### Split of all unreleased changes in different files

This PR introduces the `.changes/` folder that contains a sub-folder for
each subsection of the changelog (added, breaking, ...). When you
creates a PR you will need to create a file with the name :
`[pr_number].md` and add the text related to your changes in this file.

The job "check-changelog" has been adapted to check for this file.
You can see 3 example of usage here : 

- OltaLabs/no-conflict-keep-a-changelog-action#7
- OltaLabs/no-conflict-keep-a-changelog-action#9
-
OltaLabs/no-conflict-keep-a-changelog-action#10

The "no changelog" label is still working. Example : 

- OltaLabs/no-conflict-keep-a-changelog-action#8

### New GitHub action to edit the changelog automatically on release

When tagging a PR with a new label "pr release" it will trigger a job
that will remove all changes in the `.changes` folder and create the
section in the CHANGELOG.md file. Example :
-
OltaLabs/no-conflict-keep-a-changelog-action#11

### New PR templates

The GitHub action that creates the section in changelog require to know
the version needed to create. In order to provide that information to
the CI, a new PR template has been added that will be automatically
completed by the Action with all the changelog of this version. Example:
![Screenshot 2025-02-17
154732](https://github.com/user-attachments/assets/2d191f03-49ca-42f6-8a49-19004a3cb2da)

GitHub doesn't have an UI to choose between PR template (such as they
have for issues) and so the new default template PR contains two
clickable links (under the "Preview" section) to create a selection menu
between pull requests templates.

## Side modification

I also edited the name and email of all of our Action that commit to the
repository to be the correct github action bot and being unified

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests
- [x] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [x] I have reviewed the code myself
- [x] I have created follow-up issues caused by this PR and linked them
here
  • Loading branch information
AurelienFT authored Feb 19, 2025
1 parent 22d4173 commit f9431ef
Show file tree
Hide file tree
Showing 25 changed files with 167 additions and 48 deletions.
Empty file added .changes/.gitkeep
Empty file.
Empty file added .changes/added/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions .changes/added/2150.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgraded `libp2p` to `0.54.1` and introduced `ConnectionLimiter` to limit pending incoming/outgoing connections.
1 change: 1 addition & 0 deletions .changes/added/2491.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Storage read replays of historical blocks for execution tracing. Only available behind `--historical-execution` flag.
1 change: 1 addition & 0 deletions .changes/added/2666.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added two new CLI arguments to control the GraphQL queries consistency: `--graphql-block-height-tolerance` (default: `10`) and `--graphql-block-height-min-timeout` (default: `30s`). If a request requires a specific block height and the node is slightly behind, it will wait instead of failing.
1 change: 1 addition & 0 deletions .changes/added/2722.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Service definition for state root service.
Empty file added .changes/breaking/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions .changes/breaking/2648.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add feature-flagged field to block header `fault_proving_header` that contains a commitment to all transaction ids.
1 change: 1 addition & 0 deletions .changes/breaking/2678.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed public accessors for `BlockHeader` fields and replaced with methods instead, moved `tx_id_commitment` to the application header of `BlockHeaderV2`.
Empty file added .changes/changed/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions .changes/changed/2473.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Graphql requests and responses make use of a new `extensions` object to specify request/response metadata. A request `extensions` object can contain an integer-valued `required_fuel_block_height` field. When specified, the request will return an error unless the node's current fuel block height is at least the value specified in the `required_fuel_block_height` field. All graphql responses now contain an integer-valued `current_fuel_block_height` field in the `extensions` object, which contains the block height of the last block processed by the node.
1 change: 1 addition & 0 deletions .changes/changed/2653.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added cleaner error for wasm-executor upon failed deserialization.
1 change: 1 addition & 0 deletions .changes/changed/2705.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the default value for `--max-block-size` and `--max-transmit-size` to 50 MB
1 change: 1 addition & 0 deletions .changes/changed/2723.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change the way we are building the changelog to avoids conflicts.
Empty file added .changes/fixed/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions .changes/fixed/2646.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved performance of fetching block height by caching it when the view is created.
Empty file added .changes/removed/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/bump_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Version [X.X.X (example: 2.3.8)]

[ADD LABEL PR RELEASE AND DO NOT EDIT THE REST CI WILL GENERATE IT]
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

## Linked Issues/PRs
<!-- List of related issues/PRs -->

## Description
<!-- List of detailed changes -->

## Checklist
- [ ] Breaking changes are clearly marked as such in the PR description and changelog
- [ ] New behavior is reflected in tests
- [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [ ] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this)
- [ ] Someone else?
25 changes: 3 additions & 22 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
## Linked Issues/PRs
<!-- List of related issues/PRs -->
Please go to the `Preview` tab and select the appropriate sub-template:

## Description
<!-- List of detailed changes -->

## Checklist
- [ ] Breaking changes are clearly marked as such in the PR description and changelog
- [ ] New behavior is reflected in tests
- [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [ ] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this)
- [ ] Someone else?
* [Classic PR](?expand=1&template=default.md)
* [Bump version](?expand=1&template=bump_version.md)
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,28 @@ jobs:
name: Check Changelog
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v2
with:
changelog: CHANGELOG.md
- name: Checkout code
uses: actions/checkout@v4

- name: Check for a file with the PR number in a sub-directory of the .changes directory" or "no changelog" label.
run: |
# Check if we are on master
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
echo "On master branch, skipping changelog check."
exit 0
fi
pr_number_file=$(echo $GITHUB_REF | cut -d'/' -f3).md
if [[ $(find .changes/ -type f -name $pr_number_file -print -quit) ]]; then
echo "File $pr_number_file exists."
else
if [ "${{ contains(github.event.pull_request.labels.*.name, 'no changelog') }}" = "true" ]; then
echo "No changelog needed."
exit 0
else
echo "File $pr_number_file does not exist."
exit 1
fi
fi
rustfmt:
runs-on: buildjet-4vcpu-ubuntu-2204
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/create_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Create version

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
create_version:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'pr release' }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Get the version number in the PR description
id: get_version
run: |
# Extract the version number from the PR description
version=$(echo "${{ github.event.pull_request.body }}" | grep -oP '## Version \K[0-9]+\.[0-9]+\.[0-9]+')
echo "NEW_VERSION=${version}" >> $GITHUB_OUTPUT
- name: Gather all changes
id: gather_changes
run: |
# Define the order of sections
sections_order=("breaking" "added" "changed" "fixed" "removed")
# Process each section in the specified order
for section in "${sections_order[@]}"; do
dir_path=".changes/${section}"
if [ -d "$dir_path" ]; then
# Collect .md files sorted numerically using version sort
files=()
while IFS= read -r -d $'\0' file; do
files+=("$file")
done < <(find "$dir_path" -maxdepth 1 -type f -name '*.md' -print0 | sort -V -z)
if [ ${#files[@]} -gt 0 ]; then
# Capitalize the first letter of the section name
section_name="$(tr '[:lower:]' '[:upper:]' <<< "${section:0:1}")${section:1}"
VERSION_TEXT+="\n### $section_name\n"
for file in "${files[@]}"; do
filename=$(basename "$file" .md)
content=$(cat "$file")
VERSION_TEXT+="- [${filename}](https://github.com/FuelLabs/fuel-core/pull/${filename}): ${content}\n"
done
fi
fi
done
{
echo 'VERSION_TEXT<<EOF'
echo -e ${VERSION_TEXT}
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Update PR description with the version and changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Update the PR description with the version and changes
gh pr edit ${{ github.event.pull_request.number }} --body "## Version ${{ steps.get_version.outputs.NEW_VERSION }}
${{ steps.gather_changes.outputs.VERSION_TEXT }}"
- name: Update the CHANGELOG.md file
run: |
while IFS= read -r line; do
if [[ "$line" == "## [Unreleased (see .changes folder)]" ]]; then
echo -e "## [Unreleased (see .changes folder)]\n"
echo -e "## [Version ${{ steps.get_version.outputs.NEW_VERSION }}]"
VERSION_TEXT="${{ steps.gather_changes.outputs.VERSION_TEXT }}"
VERSION_TEXT=${VERSION_TEXT::-1}
echo -e "$VERSION_TEXT"
else
printf "%s\n" "$line"
fi
done < CHANGELOG.md > CHANGELOG.md.tmp && mv CHANGELOG.md.tmp CHANGELOG.md
cat CHANGELOG.md
- name: Delete all the .md files in the .changes directory
run: |
find .changes -type f -name '*.md' -delete
- name: Commit & push the changes
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add CHANGELOG.md
git add .changes
git commit -m "Generate changelog for v.${{ steps.get_version.outputs.NEW_VERSION }}"
git push
4 changes: 2 additions & 2 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ jobs:
- name: commit
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git switch --force-create cargo_update
git add ./Cargo.lock
git commit --no-verify --file=commit.txt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_readme_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ jobs:
# Proceed with PR creation
echo "Creating PR..."
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
branch_name="version-update-$(date +%s)"
git checkout -b "$branch_name"
Expand Down
20 changes: 1 addition & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Breaking
- [2648](https://github.com/FuelLabs/fuel-core/pull/2648): Add feature-flagged field to block header `fault_proving_header` that contains a commitment to all transaction ids.
- [2678](https://github.com/FuelLabs/fuel-core/pull/2678): Removed public accessors for `BlockHeader` fields and replaced with methods instead, moved `tx_id_commitment` to the application header of `BlockHeaderV2`.

### Added
- [2150](https://github.com/FuelLabs/fuel-core/pull/2150): Upgraded `libp2p` to `0.54.1` and introduced `ConnectionLimiter` to limit pending incoming/outgoing connections.
- [2491](https://github.com/FuelLabs/fuel-core/pull/2491): Storage read replays of historical blocks for execution tracing. Only available behind `--historical-execution` flag.
- [2666](https://github.com/FuelLabs/fuel-core/pull/2666): Added two new CLI arguments to control the GraphQL queries consistency: `--graphql-block-height-tolerance` (default: `10`) and `--graphql-block-height-min-timeout` (default: `30s`). If a request requires a specific block height and the node is slightly behind, it will wait instead of failing.
- [2722](https://github.com/FuelLabs/fuel-core/pull/2722): Service definition for state root service.

### Fixed
- [2646](https://github.com/FuelLabs/fuel-core/pull/2646): Improved performance of fetching block height by caching it when the view is created.

### Changed
- [2473](https://github.com/FuelLabs/fuel-core/pull/2473): Graphql requests and responses make use of a new `extensions` object to specify request/response metadata. A request `extensions` object can contain an integer-valued `required_fuel_block_height` field. When specified, the request will return an error unless the node's current fuel block height is at least the value specified in the `required_fuel_block_height` field. All graphql responses now contain an integer-valued `current_fuel_block_height` field in the `extensions` object, which contains the block height of the last block processed by the node.
- [2653](https://github.com/FuelLabs/fuel-core/pull/2653): Added cleaner error for wasm-executor upon failed deserialization.
- [2705](https://github.com/FuelLabs/fuel-core/pull/2705): Update the default value for `--max-block-size` and `--max-transmit-size` to 50 MB
## [Unreleased (see .changes folder)]

## [Version 0.41.7]

Expand Down

0 comments on commit f9431ef

Please sign in to comment.