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

chore: prevent unnecessary netlify builds #8755

Merged
merged 1 commit into from Jun 24, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jun 24, 2022

Description

Only rebuild on netlify when docs/**/*, package.json, pnpm-lock.yaml, or netlify.toml changed.

Additional context

A bit annoyed of the netlify build message in each PR 😅


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added the p1-chore Doesn't change code behavior (priority) label Jun 24, 2022
@netlify
Copy link

netlify bot commented Jun 24, 2022

Deploy Preview for vite-docs-main ready!

Name Link
🔨 Latest commit fc98eb9
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b566f4317387000838412c
😎 Deploy Preview https://deploy-preview-8755--vite-docs-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@patak-dev patak-dev merged commit cd59ee4 into vitejs:main Jun 24, 2022
@bluwy bluwy deleted the netlify-ignore-build branch June 24, 2022 07:36
@patak-dev
Copy link
Member

@bluwy for some reason we are getting every build canceled in netlify 🤔
For example, for #9390, that touched the docs:
This was working before so I'm a bit confused here. Maybe you have a pointer given you did this last PR?

11:03:14 AM: Build ready to start
11:04:24 AM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)
11:04:24 AM: build-image tag: focal
11:04:24 AM: buildbot version: 1f782739e873aad28ed4ef266e4159eb6d0f1401
11:04:24 AM: Fetching cached dependencies
11:04:25 AM: Failed to fetch cache, continuing with build
11:04:25 AM: Starting to prepare the repo for build
11:04:25 AM: No cached dependencies found. Cloning fresh repo
11:04:25 AM: git clone https://github.com/vitejs/vite
11:04:26 AM: Preparing Git Reference refs/heads/main
11:04:26 AM: Parsing package.json dependencies
11:04:27 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run ci-docs' versus 'yarn ci-docs' in the Netlify UI
11:04:27 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml'
11:04:27 AM: User-specified ignore command returned exit code 0. Returning early from build.
11:04:27 AM: Creating deploy upload records
11:04:27 AM: Failed during stage 'checking build content for changes': Canceled build due to no content change
11:04:28 AM: Finished processing build request in 3.222400122s

@bluwy
Copy link
Member Author

bluwy commented Jul 28, 2022

@patak-dev is there a way to see the full deploy logs (and history)? Looks like main.vitejs.dev is deploying fine (its deploy)

@patak-dev
Copy link
Member

That seems to be the only logs.

PR: #9390
It builds correctly on main.vitejs.dev: https://app.netlify.com/sites/vite-docs-main/deploys/62e0ff52db07790008c1830c
but it is canceled on vitejs.dev: https://app.netlify.com/sites/vitejs/deploys/62e0ff52db07790008c18307
(adding links just in case someone with access is checking too)

11:04:27 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml'
11:04:27 AM: User-specified ignore command returned exit code 0. Returning early from build.

It is the same config from the repo POV (https://github.com/vitejs/vite/blob/main/netlify.toml), maybe $CACHED_COMMIT_REF is the problem here? But that doesn't make sense to be shared between sites.
Evan updated the vitejs.dev site in netlify to use the latest default image, but I don't see how this can affect the canceled check. Maybe we could try another check? Or Evan said that he could create a completely new site and start over for vitejs.dev, if nothing else works

@bluwy
Copy link
Member Author

bluwy commented Jul 28, 2022

Yeah I guess $CACHED_COMMIT_REF might've been shared with main.vitejs.dev somehow, can't really tell as Netlify doesn't show the env in the logs. I had referenced the docs for the ignore command, and they recommend using $CACHED_COMMIT_REF. We could temporarily remove that if that's an issue, but it's also strange that this only happened recently.

@bluwy
Copy link
Member Author

bluwy commented Jul 28, 2022

Or maybe we can retry again when we merge #9379. Perhaps it's a fluke after some Netlify configuration.

@Evavic44
Copy link
Contributor

That seems to be the only logs.

PR: #9390 It builds correctly on main.vitejs.dev: https://app.netlify.com/sites/vite-docs-main/deploys/62e0ff52db07790008c1830c but it is canceled on vitejs.dev: https://app.netlify.com/sites/vitejs/deploys/62e0ff52db07790008c18307 (adding links just in case someone with access is checking too)

11:04:27 AM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml'
11:04:27 AM: User-specified ignore command returned exit code 0. Returning early from build.

It is the same config from the repo POV (https://github.com/vitejs/vite/blob/main/netlify.toml), maybe $CACHED_COMMIT_REF is the problem here? But that doesn't make sense to be shared between sites. Evan updated the vitejs.dev site in netlify to use the latest default image, but I don't see how this can affect the canceled check. Maybe we could try another check? Or Evan said that he could create a completely new site and start over for vitejs.dev, if nothing else works

I also noticed the changes for #9390 haven't reflected in docs, yet. Is this the reason why? @patak-dev

@patak-dev
Copy link
Member

patak-dev commented Jul 29, 2022

Removed some env variables that were preventing deploy previews to work after the image change, looks like these two are not needed anymore
image

Let's check what happens on the next docs change PR.

@patak-dev
Copy link
Member

Just checked with #9454, and the deploy was still canceled with:

4:51:09 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npx pnpm i --store=node_modules/.pnpm-store --frozen-lockfile && npm run ci-docs' versus 'yarn ci-docs' in the Netlify UI
4:51:09 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml'
4:51:09 PM: User-specified ignore command returned exit code 0. Returning early from build.

I'm out of ideas. Maybe we could ask Evan to recreate the site in netlify. Blu you can ping him or I'll do so when I'm back if this hasnt been resolved yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants