Skip to content

Commit

Permalink
hotfix -> patch, next-release -> non-patch-release
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Oct 4, 2023
1 parent d83d422 commit ca7f6f8
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ concurrency:
cancel-in-progress: true

jobs:
prepare-hotfix-pull-request:
name: Prepare hotfix pull request
prepare-patch-pull-request:
name: Prepare patch pull request
runs-on: ubuntu-latest
environment: release
defaults:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
id: check-frozen
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release:is-pr-frozen --hotfix
run: yarn release:is-pr-frozen --patch

- name: Cancel when frozen
if: steps.check-frozen.outputs.frozen == 'true' && github.event_name != 'workflow_dispatch'
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
git config --global user.email '[email protected]'
yarn release:pick-patches
- name: Cancel when no hotfixes to pick
- name: Cancel when no patches to pick
if: steps.pick-patches.outputs.pr-count == '0' && steps.pick-patches.outputs.pr-count != null
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches:
- latest-release
- next-release
- non-patch-release

env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
Expand Down Expand Up @@ -39,11 +39,11 @@ jobs:
- name: Cancel all release preparation runs
run: |
# Get a list of all running or pending release preparation runs
# combining both the prepare-hotfix-release.yml and prepare-next-release.yml workflows
# combining both the prepare-patch-release.yml and prepare-non-patch-release.yml workflows
RUNNING_RELEASE_PREPARATIONS=$(
{
gh run list --limit 50 --workflow=prepare-hotfix-release.yml --json databaseId,status
gh run list --limit 50 --workflow=prepare-next-release.yml --json databaseId,status
gh run list --limit 50 --workflow=prepare-patch-release.yml --json databaseId,status
gh run list --limit 50 --workflow=prepare-non-patch-release.yml --json databaseId,status
} | jq -rc '.[] | select(.status | contains("in_progress", "pending", "queued", "requested", "waiting")) | .databaseId'
)
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
# next will be at eg. 7.4.0-alpha.4, and main will be at 7.3.0
# then we release 7.4.0 by merging next to latest-release to main
# we then ensure here that next is bumped to 7.5.0 - without releasing it
# if this is a hotfix release bumping main to 7.3.1, next will not be touched because it's already ahead
# if this is a patch release bumping main to 7.3.1, next will not be touched because it's already ahead
- name: Ensure `next` is a minor version ahead of `main`
if: steps.target.outputs.target == 'main'
run: |
Expand Down
72 changes: 36 additions & 36 deletions CONTRIBUTING/RELEASING.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions scripts/release/__tests__/generate-pr-description.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
- [ ] [#42](https://github.com/storybookjs/storybook/pull/42): \\\`git cherry-pick -m1 -x abc123\\\`
If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-next-release.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected.
If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-non-patch-release.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected.
Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs, *especially* if you\\'re making changes to the changelog.
Expand Down Expand Up @@ -279,7 +279,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
- [ ] [#42](https://github.com/storybookjs/storybook/pull/42): \\\`git cherry-pick -m1 -x abc123\\\`
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-hotfix-release.yml) and wait for it to finish.
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.
Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs.
Expand Down Expand Up @@ -346,7 +346,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-next-release.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected.
If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-non-patch-release.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected.
Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs, *especially* if you\\'re making changes to the changelog.
Expand Down Expand Up @@ -401,7 +401,7 @@ For each pull request below, you need to either manually cherry pick it, or disc
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-hotfix-release.yml) and wait for it to finish.
If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.
Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs.
Expand Down
6 changes: 3 additions & 3 deletions scripts/release/__tests__/is-pr-frozen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ describe('isPrFrozen', () => {
await expect(isPrFrozen({ patch: false })).resolves.toBe(false);
});

it('should look for patch PRs when hotfix is true', async () => {
it('should look for patch PRs when patch is true', async () => {
getPullInfoFromCommit.mockResolvedValue({
labels: [],
});
await isPrFrozen({ hotfix: true });
await isPrFrozen({ patch: true });

expect(simpleGit.__fetch).toHaveBeenCalledWith('origin', 'version-hotfix-from-1.0.0', {
expect(simpleGit.__fetch).toHaveBeenCalledWith('origin', 'version-patch-from-1.0.0', {
'--depth': 1,
});
});
Expand Down
6 changes: 3 additions & 3 deletions scripts/release/generate-pr-description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ export const generateReleaseDescription = ({
manualCherryPicks?: string;
}): string => {
const workflow = semver.prerelease(nextVersion)
? 'prepare-next-release'
: 'prepare-hotfix-release';
? 'prepare-non-patch-release'
: 'prepare-patch-release';
const workflowUrl = `https://github.com/storybookjs/storybook/actions/workflows/${workflow}.yml`;

return (
Expand Down Expand Up @@ -218,7 +218,7 @@ export const generateNonReleaseDescription = (
${manualCherryPicks || ''}
If you've made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-hotfix-release.yml) and wait for it to finish.
If you've made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-patch-release.yml) and wait for it to finish.
Feel free to manually commit any changes necessary to this branch **after** you've done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs.
Expand Down
6 changes: 3 additions & 3 deletions scripts/release/is-pr-frozen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ program
.description(
'returns true if the versioning pull request associated with the current branch has the "freeze" label'
)
.option('-H, --hotfix', 'Look for hotfix PR instead of next PR', false)
.option('-H, --patch', 'Look for patch PR instead of next PR', false)
.option('-V, --verbose', 'Enable verbose logging', false);

const CODE_DIR_PATH = path.join(__dirname, '..', '..', 'code');
Expand Down Expand Up @@ -43,10 +43,10 @@ const getRepo = async (verbose?: boolean): Promise<string> => {
};

export const run = async (options: unknown) => {
const { verbose, hotfix } = options as { verbose?: boolean; hotfix?: boolean };
const { verbose, patch } = options as { verbose?: boolean; patch?: boolean };

const version = await getCurrentVersion();
const branch = `version-${hotfix ? 'hotfix' : 'next'}-from-${version}`;
const branch = `version-${patch ? 'patch' : 'next'}-from-${version}`;

console.log(`💬 Determining if pull request from branch '${chalk.blue(branch)}' is frozen`);

Expand Down

0 comments on commit ca7f6f8

Please sign in to comment.