Skip to content

[next][tests][examples] pin fixtures and set up auto updates - #12979

Merged
EndangeredMassa merged 18 commits into
mainfrom
smassa/pin-next
Feb 10, 2025
Merged

EndangeredMassa merged 18 commits into
mainfrom
smassa/pin-next

Conversation

@EndangeredMassa

@EndangeredMassa EndangeredMassa commented Jan 31, 2025 •

Copy link
Copy Markdown
Contributor

Having these tests run against next@canary and react@latest allows changes in those projects to break the tests unpredictably. This happens somewhat often, disrupting other work in this repo that happens to touch the builder interface or some other global invalidation of the turbo cache.

In order to bring those breaks to a predictable (and singular) place, this PR pins the Next versions to their current resolved values. There is already a cron set up to update these, which has been fixed in this PR to work more completely.

After this merges, when a new version of next@canary is published, a new PR will be opened to this repo with that change, scoping any breaks to that PR.


Key Changes:

  • split out the cron updated into two parts
    • .github/workflows/cron-update-next-canary.yml: update all of the packages/next canary fixtures
    • .github/workflows/cron-update-next-latest.yml: update the uses in other packages to latest
  • utils/update-next.js
    • fixed a bug that prevented deep traversal when looking for fixtures to update
    • generalized to allow for canary or latest updates
    • ran this updated script to produce most of the fixture changes in this PR
  • removed ignoreNextjsUpdates from most next fixtures, but left it where it appeared we wanted to test specific old versions

Considerations:

  • should this cron also pin react@latest to its resolved value?
  • see the author's comments in this PR

@changeset-bot

changeset-bot Bot commented Jan 31, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1478b72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vercel/next Patch
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@EndangeredMassa EndangeredMassa changed the title Smassa/pin next [next] pin fixtures and set up auto updates Jan 31, 2025
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
script: |
const script = require('./utils/update-next.js')
await script({ github, context, tag: 'canary' })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calls the script targeting the canary tag

workflow_dispatch:
# Run every 10 minutes https://crontab.guru/every-10-minutes
schedule:
- cron: '*/10 * * * *'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run every 10 minutes for canary checks

script: |
const script = require('./utils/update-next.js')
await script({ github, context })
await script({ github, context, tag: 'latest' })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing script updated to explicitly update some fixtures to the latest tag

"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"test": "vitest run --passWithNoTests",
"test:watch": "vitest",
"prepare": "husky install"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the husky stuff just gets in the way

{
"dependencies": {
"next": "canary",
"next": "15.2.0-canary.33",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the point of the whole PR. These canary tests fail somewhat often for various reasons, blocking other work in this repository.

By pinning these versions, we isolate some of these failures to only a single PR that updates next versions (from the utils/update-next.js script).

Comment thread utils/update-next.js
if (updatePackageJson(pkgJsonFile, newVersion)) {
updatedCount++;
}
continue;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was preventing the script from processing all of the fixtures.

Comment thread utils/update-next.js
) {
console.log(`Branch ${branch} already exists, skipping update.`);
return;
if (pkgJson.ignoreNextjsUpdates) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ignoreNextjsUpdates value was removed from over 100 fixtures in this PR so that the canary fixtures can be pinned. Any fixture with this value that was already pinned to an old version was left in place.

@socket-security

socket-security Bot commented Jan 31, 2025 •

Copy link
Copy Markdown

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] 🔁 npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected] None +1 112 MB rauchg, timneutkens, vercel-release-bot

🚮 Removed packages: npm/@ampproject/[email protected], npm/@ampproject/[email protected], npm/@ampproject/[email protected], npm/@ampproject/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@hapi/[email protected], npm/@hapi/[email protected], npm/@hapi/[email protected], npm/@next/[email protected], npm/@next/[email protected], npm/@next/[email protected], npm/@next/[email protected], npm/@next/[email protected], npm/@next/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

trek
trek previously approved these changes Jan 31, 2025
onsclom
onsclom previously approved these changes Jan 31, 2025
Comment thread utils/update-next.js Resolved
Comment thread utils/update-next.js Resolved
Co-authored-by: Austin Merrick <[email protected]>
@EndangeredMassa
EndangeredMassa dismissed stale reviews from onsclom and trek via 4099ae1 January 31, 2025 19:50
},
"dependencies": {
"@jimmy/common": "^1.0.64",
"next": "^9.1.4",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be updated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture is for next-offline, which appears to have been abandoned for 4 years. I couldn't get it to pass anymore, even pinning it to the supported versions of Next and React of the time.

Is it OK to remove this?

@EndangeredMassa EndangeredMassa changed the title [next] pin fixtures and set up auto updates [next][tests][examples] pin fixtures and set up auto updates Feb 6, 2025
@EndangeredMassa
EndangeredMassa merged commit 6a4c779 into main Feb 10, 2025
@EndangeredMassa
EndangeredMassa deleted the smassa/pin-next branch February 10, 2025 22:51
LukeSheard pushed a commit that referenced this pull request Feb 11, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Minor Changes

- Support process tracing
([#12894](#12894))

## [email protected]

### Minor Changes

- Support process tracing
([#12894](#12894))

### Patch Changes

- Fixed bug where rewrites would be applied twice in some cases
([#13040](#13040))

- Updated dependencies
\[[`cc0b7194b119f72f59f77f9fba7e7a1188dac03c`](cc0b719),
[`7e1ee69be35db77d7692c07f5eab255ce24399de`](7e1ee69),
[`1f1186f26c6189c36098c76e3acda69ccb1790e0`](1f1186f),
[`6a4c779704d777e11370a19df5bcba168dd6dd48`](6a4c779)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Support process tracing
([#12894](#12894))

### Patch Changes

- Fixed bug where rewrites would be applied twice in some cases
([#13040](#13040))

- pin fixtures and set up auto updates
([#12979](#12979))

## @vercel/[email protected]

### Minor Changes

- Add support for custom server entrypoint in React Router apps
([#13043](#13043))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`cc0b7194b119f72f59f77f9fba7e7a1188dac03c`](cc0b719)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`cc0b7194b119f72f59f77f9fba7e7a1188dac03c`](cc0b719)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`cc0b7194b119f72f59f77f9fba7e7a1188dac03c`](cc0b719)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-merge-queue Bot pushed a commit that referenced this pull request Apr 30, 2025
In #12979 the version for these
test fixtures was locked to a specific Next.js canary which can cause us
to miss regressions as no job is checking for failures on latest canary.
We plan to migrate these tests out of this repo with the new adapter
setup but we can't leave this in a potentially broken state letting our
users encounter bugs we could have caught if we didn't have these
locked.

x-ref: https://vercel.slack.com/archives/C02CDC2ALJH/p1744481510502349
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Minor Changes

- Support process tracing
([#12894](vercel/vercel#12894))

## [email protected]

### Minor Changes

- Support process tracing
([#12894](vercel/vercel#12894))

### Patch Changes

- Fixed bug where rewrites would be applied twice in some cases
([#13040](vercel/vercel#13040))

- Updated dependencies
\[[`90dd70d026529fe592da78492536a83658432283`](vercel/vercel@90dd70d),
[`0d025a1fe736563b876df7619e750e1552ac2ad3`](vercel/vercel@0d025a1),
[`b4110af6ee40e3c0f617f38e1194c0ac6b8852e3`](vercel/vercel@b4110af),
[`a3b803f90bd4fd3e81a52b44e118923ef7a110ad`](vercel/vercel@a3b803f)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Support process tracing
([#12894](vercel/vercel#12894))

### Patch Changes

- Fixed bug where rewrites would be applied twice in some cases
([#13040](vercel/vercel#13040))

- pin fixtures and set up auto updates
([#12979](vercel/vercel#12979))

## @vercel/[email protected]

### Minor Changes

- Add support for custom server entrypoint in React Router apps
([#13043](vercel/vercel#13043))

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`90dd70d026529fe592da78492536a83658432283`](vercel/vercel@90dd70d)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`90dd70d026529fe592da78492536a83658432283`](vercel/vercel@90dd70d)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`90dd70d026529fe592da78492536a83658432283`](vercel/vercel@90dd70d)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/[email protected]

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
In vercel/vercel#12979 the version for these
test fixtures was locked to a specific Next.js canary which can cause us
to miss regressions as no job is checking for failures on latest canary.
We plan to migrate these tests out of this repo with the new adapter
setup but we can't leave this in a potentially broken state letting our
users encounter bugs we could have caught if we didn't have these
locked.

x-ref: https://vercel.slack.com/archives/C02CDC2ALJH/p1744481510502349

This branch was successfully deployed

1 active deployment
Preview — 1478b724 Deployed Feb 6, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants