-
Notifications
You must be signed in to change notification settings - Fork 29
Change no changelog #1162
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
Change no changelog #1162
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| description: unimportant refactoring | ||||||
| kind: | ||||||
| - refactoring | ||||||
| pr: 1234 | ||||||
| project: cardano-rpc | ||||||
|
||||||
| project: cardano-rpc | |
| project: cardano-api |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| description: unimportant refactoring | ||||||
| kind: | ||||||
| - refactoring | ||||||
| pr: 1234 | ||||||
|
||||||
| pr: 1234 | |
| pr: 5678 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| description: Fixed some bug | ||||||
| kind: | ||||||
| - bugfix | ||||||
| - compatible | ||||||
| pr: 1235 | ||||||
|
||||||
| pr: 1235 | |
| pr: 9999 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Changelog fragment template - copy this file and fill in the fields. | ||
| # Or use 'herald new' for interactive creation. | ||
| # | ||
| # Files starting with _ are ignored by herald. | ||
| # | ||
| # Available projects and kinds are defined in .herald.yml | ||
|
|
||
| # Which project this change belongs to (see 'projects' in .herald.yml) | ||
| project: my-project | ||
| # Pull request number associated with this change | ||
| pr: 0 | ||
| # One or more change kinds (see 'kinds' in .herald.yml) | ||
| kind: | ||
| - bugfix | ||
| description: | | ||
| Describe your change here. |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,101 +1,26 @@ | ||||||||||||||
| name: Check if PR changelog was filled correctly | ||||||||||||||
| name: Check changelog fragments | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| merge_group: | ||||||||||||||
| pull_request: | ||||||||||||||
| types: [opened, edited, synchronize, ready_for_review] | ||||||||||||||
| types: [opened, synchronize, ready_for_review] | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| check-changelog: | ||||||||||||||
| if: ${{ github.event_name != 'merge_group' }} | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| steps: | ||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - uses: actions/setup-node@v4 | ||||||||||||||
| if: ${{ github.event_name != 'merge_group' }} | ||||||||||||||
| with: | ||||||||||||||
| node-version: 22 | ||||||||||||||
| fetch-depth: 0 | ||||||||||||||
|
|
||||||||||||||
| - run: npm install js-yaml@4.1.0 | ||||||||||||||
| if: ${{ github.event_name != 'merge_group' }} | ||||||||||||||
|
|
||||||||||||||
| - name: Fail if PR changelog is not correct | ||||||||||||||
| if: ${{ github.event_name != 'merge_group' }} | ||||||||||||||
| uses: actions/github-script@v8 | ||||||||||||||
| id: check-changelog | ||||||||||||||
| - uses: cachix/install-nix-action@v30 | ||||||||||||||
| with: | ||||||||||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||
| script: | | ||||||||||||||
| const yaml = require('js-yaml'); | ||||||||||||||
| const fs = require('fs'); | ||||||||||||||
| const execSync = require('child_process').execSync; | ||||||||||||||
|
|
||||||||||||||
| const prDescription = await github.rest.pulls.get({ | ||||||||||||||
| owner: context.repo.owner, | ||||||||||||||
| repo: context.repo.repo, | ||||||||||||||
| pull_number: context.issue.number | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| const changelogRegex = /# Changelog[\s\S]*?```yaml([\s\S]*?)```/; | ||||||||||||||
| const changelogMatch = prDescription.data.body.match(changelogRegex); | ||||||||||||||
| const yamlContent = changelogMatch ? changelogMatch[1].trim() : ''; | ||||||||||||||
| yamlContent || console.error('Failed to find changelog YAML section in the "Changelog" paragraph'); | ||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
| changelog = yaml.load(yamlContent)[0]; | ||||||||||||||
| } catch (e) { | ||||||||||||||
| console.error('Failed to parse YAML changelog as array:', yamlContent); | ||||||||||||||
| process.exit(1); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| try { | ||||||||||||||
| config = yaml.load(fs.readFileSync('.cardano-dev.yaml', 'utf8')); | ||||||||||||||
| } catch (e) { | ||||||||||||||
| console.error('Failed to load .cardano-dev.yaml config:', e); | ||||||||||||||
| process.exit(1); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| let isCompatibilityValid = false; | ||||||||||||||
| if (!changelog.compatibility) { | ||||||||||||||
| isCompatibilityValid = true; | ||||||||||||||
| } | ||||||||||||||
| if (!isCompatibilityValid) { | ||||||||||||||
| console.error('Changelog field "compatibility" is deprecated and no longer used. Please remove it.'); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| let isTypeValid = false; | ||||||||||||||
| const validTypeValues = Object.keys(config.changelog.options.type); | ||||||||||||||
| if (Array.isArray(changelog.type) && !!changelog.type) { | ||||||||||||||
| isTypeValid = changelog.type.every(value => validTypeValues.includes(value)); | ||||||||||||||
| } else { | ||||||||||||||
| isTypeValid = validTypeValues.includes(changelog.type); | ||||||||||||||
| } | ||||||||||||||
| if (!isTypeValid) { | ||||||||||||||
| console.error(`PR changelog has invalid type: ${changelog.type}\nExpected one, or more of: ${validTypeValues}`) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| let isProjectsValid = false; | ||||||||||||||
| // .filter(Boolean) is a trick that removes empty values from the array (see https://michaeluloth.com/javascript-filter-boolean/) | ||||||||||||||
| const validProjectsValues = execSync("ls */CHANGELOG* | cut -d/ -f1").toString().split('\n').filter(Boolean) | ||||||||||||||
| if (Array.isArray(changelog.projects) && !!changelog.projects) { | ||||||||||||||
| isProjectsValid = changelog.projects.every(value => validProjectsValues.includes(value)); | ||||||||||||||
| } else { | ||||||||||||||
| isProjectsValid = validProjectsValue.includes(changelog.projects); | ||||||||||||||
| } | ||||||||||||||
| if (!isProjectsValid) { | ||||||||||||||
| console.error(`PR changelog has invalid project: ${changelog.projects}\nExpected one, or more of: ${validProjectsValues}`) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| let isDescriptionValid = true; | ||||||||||||||
| if (changelog.description.trim() === '<insert-changelog-description-here>') { | ||||||||||||||
| console.error('PR changelog description has not been updated!') | ||||||||||||||
| isDescriptionValid = false; | ||||||||||||||
| } else if (!changelog.description.trim()) { | ||||||||||||||
| console.error('PR changelog description field is missing!') | ||||||||||||||
| isDescriptionValid = false; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (!isCompatibilityValid || !isTypeValid || !isProjectsValid || !isDescriptionValid) { | ||||||||||||||
| console.error('Failed PR changelog checks!'); | ||||||||||||||
| process.exit(1); | ||||||||||||||
| } | ||||||||||||||
| nix_path: nixpkgs=channel:nixos-unstable | ||||||||||||||
| extra_nix_config: | | ||||||||||||||
| trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= | ||||||||||||||
| substituters = https://cache.iog.io/ https://cache.nixos.org/ | ||||||||||||||
|
|
||||||||||||||
| - uses: input-output-hk/cardano-dev/herald/.github/actions/validate@mgalazyn/release-tool | ||||||||||||||
| with: | ||||||||||||||
| version: github:input-output-hk/cardano-dev/mgalazyn/release-tool | ||||||||||||||
|
Comment on lines
+24
to
+26
|
||||||||||||||
| - uses: input-output-hk/cardano-dev/herald/.github/actions/validate@mgalazyn/release-tool | |
| with: | |
| version: github:input-output-hk/cardano-dev/mgalazyn/release-tool | |
| - uses: input-output-hk/cardano-dev/herald/.github/actions/validate@3b2f9c4d5e6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 | |
| with: | |
| version: github:input-output-hk/cardano-dev/mgalazyn/release-tool?ref=3b2f9c4d5e6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||||||||||||||
| name: Release | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||
| package: | ||||||||||||||||||||||
| description: 'Package to release (must match a project in .herald.yml)' | ||||||||||||||||||||||
| required: true | ||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||
| options: | ||||||||||||||||||||||
| - cardano-api | ||||||||||||||||||||||
| - cardano-api-gen | ||||||||||||||||||||||
| - cardano-rpc | ||||||||||||||||||||||
| - cardano-wasm | ||||||||||||||||||||||
| version: | ||||||||||||||||||||||
| description: 'Explicit version (A.B.C.D). Leave empty for auto-bump.' | ||||||||||||||||||||||
| required: false | ||||||||||||||||||||||
| type: string | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| release: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - uses: cachix/install-nix-action@v30 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| nix_path: nixpkgs=channel:nixos-unstable | ||||||||||||||||||||||
| extra_nix_config: | | ||||||||||||||||||||||
| trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= | ||||||||||||||||||||||
| substituters = https://cache.iog.io/ https://cache.nixos.org/ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - uses: input-output-hk/cardano-dev/herald/.github/actions/release@mgalazyn/release-tool | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| package: ${{ inputs.package }} | ||||||||||||||||||||||
| version: ${{ inputs.version }} | ||||||||||||||||||||||
|
Comment on lines
+41
to
+42
|
||||||||||||||||||||||
| package: ${{ inputs.package }} | |
| version: ${{ inputs.version }} | |
| package: ${{ github.event.inputs.package }} | |
| version: ${{ github.event.inputs.version }} |
Copilot
AI
Mar 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow uses an external action and a herald-ref that point at a moving branch (@mgalazyn/release-tool). For supply-chain safety and reproducibility, pin these to an immutable tag or commit SHA (and keep herald-ref consistent with that pin).
| - uses: input-output-hk/cardano-dev/herald/.github/actions/release@mgalazyn/release-tool | |
| with: | |
| package: ${{ inputs.package }} | |
| version: ${{ inputs.version }} | |
| herald-ref: github:input-output-hk/cardano-dev/mgalazyn/release-tool | |
| - uses: input-output-hk/cardano-dev/herald/.github/actions/release@6d5f6e845214071c5b66f0cc8b015f0f8baf0da3 | |
| with: | |
| package: ${{ inputs.package }} | |
| version: ${{ inputs.version }} | |
| herald-ref: github:input-output-hk/cardano-dev/6d5f6e845214071c5b66f0cc8b015f0f8baf0da3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Herald configuration | ||
| # Changelog and release automation for PVP-versioned Haskell projects | ||
|
|
||
| # Git repository in owner/repo format (used for PR links in changelogs) | ||
| git-repo: intersectmbo/cardano-api | ||
|
|
||
| # Directory for changelog fragments, relative to repo root | ||
| # Fragments are YAML files created by 'herald new' and consumed by 'herald batch' | ||
| changes-dir: .changes | ||
|
|
||
| # Change kinds and their properties | ||
| # | ||
| # Each kind defines: | ||
| # notable: if true, changes of this kind appear in the changelog | ||
| # if false, they still bump the version but are omitted from the changelog text | ||
| # bump: PVP version component to bump when this kind is present | ||
| # 0.1.0.0 = bump 2nd component (breaking changes) | ||
| # 0.0.1.0 = bump 3rd component (features, compatible changes) | ||
| # 0.0.0.1 = bump 4th component (patches, internal changes) | ||
| # | ||
| # The highest bump across all fragment kinds determines the final version bump. | ||
| kinds: | ||
| breaking: | ||
| bump: 0.1.0.0 | ||
| description: the API has changed in a breaking way | ||
| bugfix: | ||
| bump: 0.0.0.1 | ||
| description: fixes a defect | ||
| compatible: | ||
| bump: 0.0.1.0 | ||
| description: the API has changed but is non-breaking | ||
| documentation: | ||
| notable: false | ||
| bump: 0.0.0.1 | ||
| description: change in code docs, haddocks | ||
| feature: | ||
| bump: 0.0.1.0 | ||
| description: introduces a new feature | ||
| maintenance: | ||
| notable: false | ||
| bump: 0.0.0.1 | ||
| description: not directly related to the code | ||
| optimisation: | ||
| bump: 0.0.0.1 | ||
| description: measurable performance improvements | ||
| refactoring: | ||
| notable: false | ||
| bump: 0.0.0.1 | ||
| description: code quality improvements | ||
| release: | ||
| notable: false | ||
| bump: 0.0.0.1 | ||
| description: related to a new release preparation | ||
| test: | ||
| notable: false | ||
| bump: 0.0.0.1 | ||
| description: fixes or modifies tests | ||
|
|
||
| # Projects in this repository | ||
| # | ||
| # Each project needs: | ||
| # changelog: path to the project's CHANGELOG.md (relative to repo root) | ||
| # cabal-file: (optional) path to the project's .cabal file (version is read/updated here) | ||
| projects: | ||
| cardano-api: | ||
| changelog: cardano-api/CHANGELOG.md | ||
| cabal-file: cardano-api/cardano-api.cabal | ||
| cardano-api-gen: | ||
| changelog: cardano-api-gen/CHANGELOG.md | ||
| cabal-file: cardano-api-gen/cardano-api-gen.cabal | ||
| cardano-rpc: | ||
| changelog: cardano-rpc/CHANGELOG.md | ||
| cabal-file: cardano-rpc/cardano-rpc.cabal | ||
| cardano-wasm: | ||
| changelog: cardano-wasm/CHANGELOG.md | ||
| cabal-file: cardano-wasm/cardano-wasm.cabal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog fragment has a placeholder PR number (
pr: 1234). Herald validation expects fragmentprto match the current PR number; please update it accordingly (and keep it consistent across all fragments in this PR).