You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "matrei (via GitHub)" <gi...@apache.org> on 2026/10/22 09:08:46 UTC

[PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

matrei opened a new pull request, #16726:
URL: https://github.com/apache/grails-core/pull/16726

   ## Summary
   
   This is a follow-up to #16673. It contains the review points that were still open when it was merged: @codeconsole's change request and the second review round.
   
   ### Publish chain after a cancel
   
   **The problem.** `publishGradle` needed only `buildGradle`. Since #16673, a newer push cancels the run in flight, and the publish jobs run on `always()`. So on any push run, a cancel more than a few minutes in still published part of the superseded commit:
   
   - **Run with tests:** the Gradle plugins were published, but not the core. 8.0.x run 39638916842 shows this. Its `publishGradle` published at 17:13, and a newer push cancelled the run at 17:26, before its tests had finished.
   - **Run without tests** (every push to 7.x): the plugins, core and docs were published, but not Forge, which was still building. @codeconsole found this case.
   
   **The fix.** `publishGradle` now also waits for `buildForge` and `validateDependencies`, with the same explicit `success` checks. `publish` and everything after it already wait for `publishGradle`, so:
   
   - A cancel before the builds finish publishes nothing of that commit.
   - A commit whose Forge build or dependency validation failed is no longer published.
   - A cancel after the builds still lets the chain publish what it can:
     - on a run without tests, the whole chain;
     - on a run whose tests are still running, only the Gradle plugins;
     - on a run whose tests have all passed, the whole chain.
   
   The comments in `gradle.yml` and the CI policy section of `AGENTS.md` now describe this, instead of saying that a cancelled commit is never published.
   
   **The cost** is that the plugin snapshot is published later. On a 7.0.x push without tests it starts after the Forge build, about 10 minutes in instead of about 5. On 8.0.x the Forge build takes 35 to 45 minutes, so the plugin snapshot can appear up to about half an hour later. The core publish on a run with tests is unchanged, because it already waits for tests that take longer than either build.
   
   ### Docs
   
   - **`AGENTS.md`:**
     - The snapshot publish is no longer listed among the jobs that run on pull requests. It runs on a push, and on a manual run except for the docs.
     - The CI policy section names force-cancel (`gh api -X POST repos/apache/grails-core/actions/runs/<run id>/force-cancel`) for a publish that a normal cancel cannot stop. The upload's retry step lets a stuck publish keep running for hours.
   - **`CONTRIBUTING.md`:** no longer says that every push to a branch cancels the run in flight. Only CI and the Groovy joint build do; for drafts, the relevant case is a push to a pull request, which every workflow cancels.
   - **`RELEASE.md`:** notes that a merge to the release branch cancels the manual test run, because both share a concurrency group.
   
   ## Not changed here, for discussion
   
   These are policy questions rather than bugs, so they are left for the weekly:
   
   1. **`[skip tests]` on pull requests from forks.** Since #16673, a `[skip tests]` head commit skips the tests on a pull request into 8.0.x and above too, and on a fork pull request the author picks that commit. Should the marker count on a pull request only when `github.event.pull_request.author_association` is `OWNER`, `MEMBER` or `COLLABORATOR`? (@codeconsole)
   2. **`run ci` on drafts.** On a draft, `run ci` now also runs the full test matrix, so a draft can't get a build-only run. A draft into a side branch that is labelled to get any CI now runs everything. Should a separate `run tests` label ask for the tests, so that `run ci` only means "run CI on this draft"?
   
   ## Verification
   
   - **Job-graph check:**
     - Every workflow parses, and in each one every `needs` resolves.
     - Every job that reads a `needs` result lists that job, there is no cycle, and every `always()` job checks the result of every job it needs.
     - The same check passes on the result of merging this into 8.0.x, which `git merge-tree` reports as conflict-free.
   - **actionlint 1.7.7:** clean on the changed workflows. Its shellcheck notes are all in scripts this change doesn't touch.
   - **`./gradlew rat`:** passes.
   - **Publish chain under cancels.** I modelled `gradle.yml`'s job graph with GitHub's documented rules and cancelled it at every minute. The timings are rounded from the 7.0.x merge push of #16673: builds end at 4, 5 and 11 minutes, and tests at 61.
   
     | Run | Cancel arrives | Before (publishGradle needs buildGradle) | After (it needs every build) |
     |---|---|---|---|
     | without tests | before `buildGradle` ends | nothing | nothing |
     | without tests | after `buildGradle`, before `buildForge` ends | plugins, core, docs | nothing |
     | without tests | after every build | everything | everything |
     | with tests | before `buildGradle` ends | nothing | nothing |
     | with tests | after `buildGradle`, before `buildForge` ends | plugins | nothing |
     | with tests | after the builds, tests running | plugins | plugins |
     | with tests | after every test passed | everything | everything |
   
   - **First real run.** The publish jobs only run on a push in `apache`, so the merge push to 7.0.x is the first real run of this change. On that run, `publishGradle` should start after `buildForge`, and `publish`, `publishForge`, `verifyWrapper` and `docs` should follow as before.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6344719246

   @matrei Let's discuss these 2 items in the weekly and then merge what's been done already?  Do you agree? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6349203738

   ## 🔎 No tests executed 🔎
   
   🏷️ Commit: dbf938c01d7d1698379c86c9f764db03ff6d0b5a
   ▶️ Tests:  0 executed
   ⚪️ Checks: 33/33 completed
   
   ---
   _Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6499810156

   @jdaugherty, agreed. I've merged 7.0.x in to resolve the conflict with #16779 in `CONTRIBUTING.md`, and recorded the weekly's outcome in the description. The `[skip tests]` change will follow in its own pull request once this is merged. From my side this is ready to merge.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6341268652

   @matrei thank you for following up on this.
   
   * I agree with the publish changes / the changes you've made.
   
   As for the discussion topics:
   * A merge of the PR creates it's own commit, so skip tests doesn't skip unless someone intentionally adds `[skip tests]` to the merge commit.  Since we control the behavior on merge, I don't think any change is required here.
   * I don't think I understand the point about drafts: It was my understanding we only publish from X.X.X branches. By default, the drafts won't run.  If you want to run normal CI as they did before this change, we would add `run ci`.  What am I missing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #16726:
URL: https://github.com/apache/grails-core/pull/16726


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6502228190

   ## 🚨 Jobs failed without executing tests 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Build Health / Forge Projects](https://github.com/apache/grails-core/actions/runs/40894401680/job/123519464776?pr=16726)
   ❌ [Licensing - RAT Report / rat-audit](https://github.com/apache/grails-core/actions/runs/40894401745/job/123519464727?pr=16726)
   
   🏷️ Commit: 93b8c0e9d4b930ed40c458119bb63b25c78fb5d1
   ▶️ Tests:  0 executed
   🟡 Checks: 4/12 completed
   
   ### Rerun Controls
   
   Click the checkbox to trigger a rerun:
   
   🔲 **Rerun jobs**
   
   ---
   _Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6343531428

   Thanks both.
   
   @codeconsole, you're right about the cost: on a run without tests, everything after `publishGradle` moves back by the same amount. I've corrected the cost section of the description with the numbers from 39615263956 and 39644767954, and added a "Merging up" section.
   
   @jdaugherty, the drafts point isn't about publishing, sorry for the confusion. On a draft, `run ci` does two things: it lets the draft run at all, and it asks for the tests. So a draft into 7.0.x, or into a side branch, gets either no CI or the full test matrix. It never gets the build-only run it gets once it's marked ready. Before #16673 every draft ran the full matrix, so nothing is lost compared with that. If that's how you want it, I'm fine leaving it.
   
   On `[skip tests]`, @codeconsole's reply covers what I meant. A squash merge of a single-commit PR, or a rebase merge, keeps the commit's title. And on a fork PR into 8.0.x, the PR's own tests never run. Happy to leave that for the weekly.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#issuecomment-6337143216

   ## 🚨 Jobs failed without executing tests 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Code Style / Forge Projects](https://github.com/apache/grails-core/actions/runs/39753143366/job/119738412021?pr=16726)
   
   🏷️ Commit: 08d81a029655594f4af0d9bedb17c44afd3e4e9e
   ▶️ Tests:  0 executed
   🟡 Checks: 15/26 completed
   
   ### Rerun Controls
   
   Click the checkbox to trigger a rerun:
   
   🔲 **Rerun jobs**
   
   ---
   _Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "codeconsole (via GitHub)" <gi...@apache.org>.
codeconsole commented on code in PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#discussion_r4349501293


##########
.github/workflows/gradle.yml:
##########
@@ -31,9 +31,15 @@ on:
 # results would be for a superseded commit, and the run that replaces it publishes the newer one. The publish
 # jobs (publishGradle, publish, publishForge, verifyWrapper, docs) run on always() with explicit result checks
 # instead, so a publish that has started completes: an interrupted upload would leave the snapshot repository
-# with modules from two commits. Nothing of the cancelled commit is published when the cancel arrives before
-# publish starts, because a cancelled test job fails the explicit checks. The replacing run is pending until
-# the cancelled run has finished every job, so two publishes of the same branch never overlap.
+# with modules from two commits. publishGradle waits for every build job (buildGradle, buildForge and
+# validateDependencies), so nothing of the cancelled commit is published when the cancel arrives before the
+# builds have finished. A later cancel lets the publish jobs whose needs have already succeeded or been skipped
+# run: on a run without tests that is the whole chain, and on a run whose tests are still running only
+# publishGradle, because a cancelled test job fails the explicit checks of publish and of everything after it.

Review Comment:
   `buildRerunTasks` is a test job, but it isn't in `publish`'s `needs`. While it is the only test job still running, this sentence (and the same one at AGENTS.md:258) doesn't hold. Its result is never checked either, so the core is published even if it fails.
   
   The window shows up in real runs. In 8.0.x run 39644767954:
   - `publish` started 236.7 minutes in, right after the last `Build Grails-Core` leg finished.
   - `Build Grails-Core Rerunning all Tasks` kept running until 260.3.
   
   A cancel during those 24 minutes publishes the whole chain, and a failure there wouldn't have stopped it either. On 8.0.x, `casSecurityConfig` is missing from `publish`'s `needs` in the same way: it was added in 155a845537, after ee2b4817da made the test jobs gate the publish.
   
   I'd add `buildRerunTasks` to `publish`'s `needs` here, with the same `success || skipped` check, and add `casSecurityConfig` in the merge-up. In 39644767954 that would have delayed the core snapshot by those 24 minutes. If that's too slow, narrow the wording to "a cancelled test job that publish needs" instead.



##########
.github/workflows/gradle.yml:
##########
@@ -536,14 +542,18 @@ jobs:
           -PonlyHibernate5Tests
           -PskipCodeStyle
   publishGradle:
-    # always() with an explicit result check, see the concurrency comment at the top.
+    # always() with explicit result checks, see the concurrency comment at the top. It waits for every build job,
+    # not only buildGradle, so that a run cancelled before its builds have finished publishes nothing, and a
+    # commit whose Forge build or dependency validation failed is not published.
     if: >-
       ${{ always() &&
           github.repository_owner == 'apache' &&
           (github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
-          needs.buildGradle.result == 'success'
+          needs.buildGradle.result == 'success' &&
+          needs.buildForge.result == 'success' &&
+          needs.validateDependencies.result == 'success'
       }}
-    needs: [ buildGradle ]
+    needs: [ buildGradle, buildForge, validateDependencies ]

Review Comment:
   This merges into 8.0.x and 9.0.x without conflicts, but both branches also have `validateBomProperties`, `buildLogic` and `validateGithubBranch`, and none of them is in these `needs`. In 39644767954 all three finished well before `buildForge` (at 7.3, 15.3 and 7.0 minutes, against 55.9), so the cancel behaviour still holds there. The problems are elsewhere:
   - A commit whose BOM property validation failed would still be published.
   - On those branches, "every build job (buildGradle, buildForge and validateDependencies)" in the comment at the top would no longer be true.
   
   It's worth adding the three jobs to `needs` and to the check in the merge-up commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Publish nothing of a CI run cancelled before its builds finish, and correct the CI policy docs [grails-core]

Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on code in PR #16726:
URL: https://github.com/apache/grails-core/pull/16726#discussion_r4349738140


##########
.github/workflows/gradle.yml:
##########
@@ -31,9 +31,15 @@ on:
 # results would be for a superseded commit, and the run that replaces it publishes the newer one. The publish
 # jobs (publishGradle, publish, publishForge, verifyWrapper, docs) run on always() with explicit result checks
 # instead, so a publish that has started completes: an interrupted upload would leave the snapshot repository
-# with modules from two commits. Nothing of the cancelled commit is published when the cancel arrives before
-# publish starts, because a cancelled test job fails the explicit checks. The replacing run is pending until
-# the cancelled run has finished every job, so two publishes of the same branch never overlap.
+# with modules from two commits. publishGradle waits for every build job (buildGradle, buildForge and
+# validateDependencies), so nothing of the cancelled commit is published when the cancel arrives before the
+# builds have finished. A later cancel lets the publish jobs whose needs have already succeeded or been skipped
+# run: on a run without tests that is the whole chain, and on a run whose tests are still running only
+# publishGradle, because a cancelled test job fails the explicit checks of publish and of everything after it.

Review Comment:
   Good catch, thanks. I added `buildRerunTasks` to the `needs` and the checks of `publish` in dbf938c01d7. I'd rather take the 24 minutes than publish a core whose `--rerun-tasks` build failed: it is the only core test run whose results can't come from the build cache.
   
   The same commit adds a line to the publish comment and a rule to `AGENTS.md`: every test job goes into the `needs` of `publish`, and every job that builds or validates without tests goes into those of `publishGradle`. That should catch the next `casSecurityConfig`.
   



##########
.github/workflows/gradle.yml:
##########
@@ -536,14 +542,18 @@ jobs:
           -PonlyHibernate5Tests
           -PskipCodeStyle
   publishGradle:
-    # always() with an explicit result check, see the concurrency comment at the top.
+    # always() with explicit result checks, see the concurrency comment at the top. It waits for every build job,
+    # not only buildGradle, so that a run cancelled before its builds have finished publishes nothing, and a
+    # commit whose Forge build or dependency validation failed is not published.
     if: >-
       ${{ always() &&
           github.repository_owner == 'apache' &&
           (github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
-          needs.buildGradle.result == 'success'
+          needs.buildGradle.result == 'success' &&
+          needs.buildForge.result == 'success' &&
+          needs.validateDependencies.result == 'success'
       }}
-    needs: [ buildGradle ]
+    needs: [ buildGradle, buildForge, validateDependencies ]

Review Comment:
   Agreed. With `buildRerunTasks` added, the merge-up now conflicts on the `needs` line of `publish` on 8.0.x and above, because those branches also list `hibernate7Functional` and `neo4jFunctional` there. So the merge-up needs a hand anyway. I checked this resolution on 8.0.x, 8.1.x and 9.0.x:
   
   ```yaml
   publishGradle:
     needs: [ buildGradle, buildForge, validateDependencies, validateBomProperties, validateGithubBranch, buildLogic ]
   publish:
     needs: [ publishGradle, build, buildRerunTasks, functional, security, securityConfig, casSecurityConfig, redis, hibernate5Functional, hibernate7Functional, mongodbFunctional, neo4jFunctional ]
   ```
   
   It also needs the matching result checks (`success` for the new build jobs, `success || skipped` for `casSecurityConfig`), and the three build jobs added to the list in the comment at the top and in `AGENTS.md`. With that, the job-graph check passes on all three branches, every job is upstream of `publish`, and actionlint is clean. I can do the 8.0.x merge-up of this PR myself, or open a PR against 8.0.x right after it, whichever suits whoever merges up.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org