Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-100072: only trigger netlify builds for doc changes#100074

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 5 commits intopython:mainfromsobolevn:issue-100072
Dec 7, 2022

Conversation

@sobolevn
Copy link
Member

@sobolevnsobolevn commentedDec 7, 2022
edited by bedevere-bot
Loading

This PR will trigger the netlify build because ofnetlify.toml change, but hopefully it won't trigger changes anymore for other builds without./Doc or./Misc changes.

Open question: do we need./Misc here? AllNEWS go there, many PRs have it. But, I don't think we are really interested in rendering news. Opinions?

CC@Mariatta@hugovk@epicfaace

@netlify
Copy link

netlifybot commentedDec 7, 2022
edited
Loading

Deploy Preview forpython-cpython-preview ready!

NameLink
🔨 Latest commit35c4b75
🔍 Latest deploy loghttps://app.netlify.com/sites/python-cpython-preview/deploys/6390daa639c5580009d1c81d
😎 Deploy Previewhttps://deploy-preview-100074--python-cpython-preview.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 yourNetlify site settings.

@hugovk
Copy link
Member

Thanks! Looks like it needs a bit of tuning.

I added this to my fork'smain, which has Netlify enabled:hugovk@71faec4

Then created two PRs inside my fork, one with aLib/ change, another with aDoc/ change:

But Netlify built both.

@sobolevn
Copy link
MemberAuthor

Hm, maybe like this?

@hugovk
Copy link
Member

Added that to my fork'smain:hugovk@24060c3

Rebased the two PRs but both had Netlify builds.

@sobolevn
Copy link
MemberAuthor

This command should work:

git diff --name-only| grep -q'^Doc/'&&exit 1||exit 0

An exit code of 1 indicates the contents have changed and the build process continues as usual. An exit code of 0 indicates that there are no changes and the build should stop.

Prep:

echo'a'>> Doc/glossary.rst

Local tests (I useecho instead ofexit for demo):

» git diff --name-only| grep -q'^Lib/'&&echo 1||echo 00» git diff --name-only| grep -q'^Doc/'&&echo 1||echo 01

Do you agree?

@hugovk
Copy link
Member

With local testing, yes.

With Netlify, no...

hugovk@abbc30d shows "Deploy Preview canceled." for both PRs...

hugovk#34 with no docs change:

7:35:00 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --name-only | grep -q '^Doc/' && exit 1 || exit 0'7:35:01 PM: User-specified ignore command returned exit code 0. Returning early from build.7:35:01 PM: Creating deploy upload records7:35:01 PM: Failed during stage 'checking build content for changes': Canceled build due to no content change7:35:01 PM: Finished processing build request in 13.44133397s

hugovk#35 with docs change:

7:35:15 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --name-only | grep -q '^Doc/' && exit 1 || exit 0'7:35:16 PM: User-specified ignore command returned exit code 0. Returning early from build.7:35:16 PM: Creating deploy upload records7:35:17 PM: Failed during stage 'checking build content for changes': Canceled build due to no content change7:35:17 PM: Finished processing build request in 12.800699818s

Rewinding and looking at the logs for#100074 (comment):

hugovk#34 without docs change:

4:57:39 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF Doc/ netlify.toml'4:57:40 PM: fatal: ambiguous argument 'Doc/': unknown revision or path not in the working tree.4:57:40 PM: Use '--' to separate paths from revisions, like this:4:57:40 PM: 'git <command> [<revision>...] -- [<file>...]'

hugovk#35 with docs change:

4:56:02 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF Doc/ netlify.toml'4:56:02 PM: fatal: ambiguous argument 'Doc/': unknown revision or path not in the working tree.4:56:02 PM: Use '--' to separate paths from revisions, like this:4:56:02 PM: 'git <command> [<revision>...] -- [<file>...]'

So we've already setbase = "Doc/",where:

The base directory setting prompts our buildbots to change to the specified directory to detect dependencies and perform caching during the build process. It’s useful for building from a monorepo or subdirectory.

So let's trygit diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../netlify.toml:hugovk@1810da0

I also cleared the deploy caches, in case the rebase/force pushes

hugovk#34 without docs change - no Netlify build! ✅:

8:13:58 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../netlify.toml'8:13:58 PM: User-specified ignore command returned exit code 0. Returning early from build.8:13:58 PM: Creating deploy upload records8:13:58 PM: Failed during stage 'checking build content for changes': Canceled build due to no content change8:13:59 PM: Finished processing build request in 37.864234653s

hugovk#35 with docs change - has Netlify build! ✅:

8:11:51 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: 'git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF . ../netlify.toml'8:11:51 PM: Section completed: initializing8:11:51 PM: Starting build script...

So let's try this!

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@sobolevn
Copy link
MemberAuthor

Thanks,base is something I have completely missed!

hugovk reacted with rocket emoji

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

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

Thank you, let's give this a shot!

@sobolevn
Copy link
MemberAuthor

Thankyou for testing and finding a solution ;)

hugovk reacted with thumbs up emoji

@hugovkhugovk merged commitd92407e intopython:mainDec 7, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hugovkhugovkhugovk approved these changes

@ezio-melottiezio-melottiAwaiting requested review from ezio-melotti

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@sobolevn@hugovk@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp