-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore(workflows): enhance netlify build CI workflow to reflect status of triggered builds and furnish build details #22137
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
base: develop
Are you sure you want to change the base?
Conversation
|
Hi @pranav-new-relic 👋 Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days. Please ensure the propsed changes look good by building it first in your local environment. Refer to this contribution guide to get the site up and running in your local. If you really require a preview url, reach out to one of the writers and they will generate one for you. |
|
|
🚀 Netlify Preview Building!If the build is successful, the preview for this pull request will be available at the following URL (usually takes 10-20 minutes): |
|
|
🚀 Netlify Preview Building!Build triggered for PR #22137 (commit: ⏳ Monitoring deployment status... This usually takes 10-20 minutes. |
|
🚨 ⛔ NETLIFY DEPLOYMENT FAILED ⛔ 🚨❌ DO NOT MERGE THIS PR ❌The Netlify preview deployment has FAILED. This PR contains changes that break the build process. 🔴 Critical Issue Details:
🔗 Netlify Deployment: View Deployment 🛠️ Required Actions:
|
🚀 Netlify Preview Building!Build triggered for PR #22137 (commit: ⏳ Monitoring deployment status... This usually takes 10-20 minutes. |
|
🚨 ⛔ NETLIFY DEPLOYMENT FAILED ⛔ 🚨❌ DO NOT MERGE THIS PR ❌The Netlify preview deployment has FAILED. This PR contains changes that break the build process. 🔴 Critical Issue Details:
🔗 Netlify Deployment: View Deployment 🛠️ Required Actions:
|
🚀 Netlify Preview Building!Build triggered for PR #22137 (commit: ⏳ Monitoring deployment status... This usually takes 10-20 minutes. |
|
🚀 Netlify Preview Building!Build triggered for PR #22137 (commit: ⏳ Monitoring deployment status... This usually takes 10-20 minutes. |
🚀 Netlify Preview Building!Build triggered for PR #22137 (commit: ⏳ Monitoring deployment status... This usually takes 10-20 minutes. |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 00:39:11 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
🚀 Netlify Preview Building...(Update logged at: 11/26/2025, 00:41:44 IST | Commit:
⏳ Monitoring deployment status... This usually takes 10-20 minutes. ⏳ Netlify Deployment In Progress(Update logged at: 11/26/2025, 00:44:53 IST | Commit:
⏳ Build is currently in progress. Monitoring status... ✅ Netlify Preview Deploy Successful!(Update logged at: 11/26/2025, 24:53:57 IST | Commit:
The preview is ready for review. Please test your changes thoroughly before merging. |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 00:42:44 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
🚀 Netlify Preview Building...(Update logged at: 11/26/2025, 01:05:38 IST | Commit:
⏳ Monitoring deployment status... This usually takes 10-20 minutes. ⏳ Netlify Deployment In Progress(Update logged at: 11/26/2025, 01:08:51 IST | Commit:
⏳ Build is currently in progress. Monitoring status... ✅ Netlify Preview Deploy Successful!(Update logged at: 11/26/2025, 01:11:54 IST | Commit:
The preview is ready for review. Please test your changes thoroughly before merging. |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 01:06:30 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 01:09:55 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
🚀 Netlify Preview Building...(Update logged at: 11/26/2025, 01:15:54 IST | Commit:
⏳ Monitoring deployment status... This usually takes 10-20 minutes. ⏳ Netlify Deployment In Progress(Update logged at: 11/26/2025, 01:16:57 IST | Commit:
⏳ Build is currently in progress. Monitoring status... ✅ Netlify Preview Deploy Successful!(Update logged at: 11/26/2025, 01:21:30 IST | Commit:
The preview is ready for review. Please test your changes thoroughly before merging. |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 01:17:27 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
⏳ A Netlify Deployment is Already in Progress(Update logged at: 11/26/2025, 01:18:04 IST | Commit: An existing deployment for this branch is currently running. Please wait for it to complete before starting a new one.
Once the previous deployment is finished, you can trigger a new build by commenting |
🚀 Netlify Preview Building...(Update logged at: 11/26/2025, 01:28:27 IST | Commit:
⏳ Monitoring deployment status... This usually takes 10-20 minutes. ⏳ Netlify Deployment In Progress(Update logged at: 11/26/2025, 01:29:15 IST | Commit:
⏳ Build is currently in progress. Monitoring status... ✅ Netlify Preview Deploy Successful!(Update logged at: 11/26/2025, 01:33:48 IST | Commit:
The preview is ready for review. Please test your changes thoroughly before merging. |
|
@copilot would you mind generating a comprehensive PR description, encompassing all of the changes covered by this PR? I would like the PR to be comprehensive, but not too detailed - it can be concise, briefly explain things it adds. The description does not need to include a lot of jargon or be too technically complex; it can talk about the problem statement (why is this needed in the first place - the benefits of this), an outline of the approach, the working of it in a logical flow of events for someone to understand, and a similarly structured concise description - ensuring all cases covered by the workflow are explained in brief too. |
|
@pranav-new-relic I've opened a new pull request, #22289, to work on those changes. Once the pull request is ready, I'll request review from you. |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 days ago
To fix this problem, we should explicitly declare the permissions key at the start of the workflow file, just after the name (and before on:). This key should minimally grant contents: read (as required to allow workflows to fetch repo contents) and issues: write (because the workflow uses GitHub Actions and actions/github-script to comment on issues and PRs). Other permissions (such as pull-requests: write) are not strictly necessary unless the workflow edits PRs or labels, which, based on the workflow steps, it does not.
The fix involves adding the following block near the top of .github/workflows/final-manual-deploy-comment.yml:
permissions:
contents: read
issues: writeThis will scope the automatic GITHUB_TOKEN to the minimal required privileges for all jobs. No other changes are needed.
-
Copy modified lines R3-R6
| @@ -1,5 +1,9 @@ | ||
| name: Final 'Comment' Netlify Build + Build Reportage (Manual Deploy) | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] |
✨ Summary
Enhances the Netlify deployment preview workflow with deployment tracking, and comprehensive error handling.
Why do (I think) we need this?
The current workflow that is triggered upon commenting
netlify buildon the PR only "triggers" a build on Netlify, but does not report the status of the build back - implying that the CI check triggered by thenetlify buildends at triggering the build, and succeeds all the time. This leads to an incomplete check, and the onus is on the reviewers of the PR to go to Netlify to find the status of the build, as a preview link is returned by the current workflow if it is successful; else, it returns nothing.While this is the current process, this leaves a lot of room for erroenous considerations to be made; it is highly probable that
and all of this did occur multiple times in the past; neither does the CI check fail (it succeeds all the time) so we do not obstruct a merge, nor do we notify the maintainers in the PR's comments that the build is screwed - leading to the check getting ignored at times, causing a major debacle later on in the daily release PRs.
Obviously, all of this hassle is now seen because we no longer use Netlify's Deploy Preview feature (which would handle the entire process of building on a commit, and notifying maintainers) - and when we do not do so, the only way to get the status of a build, is to:
I did try (1) with #22133, only to realise that GitHub CI's runners are too lightweight to run a heavy job like scaffolding Netlify and dependencies via npm, and then run a build - most builds kept running for over 1hr 50 minutes and eventually timed out; implying, this method is infeasible - so (2) seemed to be the only route. This is the approach proposed by the workflow modified in this PR.
In simpler words, the workflow's trigger remains the same - a
netlify buildcomment, and the immediate step after this remains the same too - triggering a build on Netlify using the Netlify API. Post this, a bunch of additional steps have been added.netlify buildcomment was made to trigger the build) - after which a build is identified, and this build is monitored by the workflow.A few other changes do exist too, e.g. checking for any existing builds on the branch to prevent "concurrent" builds running (to save resources), using branch based filtering if a commit-based build is not found, checking if the build times out and adding comments accordingly, checking for credential expiry, and a bunch of edge cases I could think of.
The success comment looks like this.
The failure comment looks like this.
Upon commenting
netlify build, if it is found that there is a build associated with this branch that is already in progress, this is the comment shown.Netlify Workflow Improvements
Deployment Discovery & Monitoring
Outcome Handling
Pre-deployment Validation