This is an automated email from the ASF dual-hosted git repository.
yuqi1129 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 783025be11 [MINOR] improvement(ci): Explain pending trusted
verification and recovery (#15089)
783025be11 is described below
commit 783025be1169f61a1aeceeb624aaa5142687478d
Author: Qi Yu <[email protected]>
AuthorDate: Thu Nov 19 09:55:17 2026 +0800
[MINOR] improvement(ci): Explain pending trusted verification and recovery
(#15089)
### What changes were proposed in this pull request?
Explain the reason and next action directly in the pending Fork CI
status:
> Fork CI passed; CI files differ from target branch. Committer: run
Fork CI in apache/gravitino on that branch with this PR number.
The 130-character description fits GitHub's status limit. Keep
recognizing the previous description as a completed fork execution, and
refresh existing pending statuses to the new instructions.
### Why are the changes needed?
The previous message, `Fork CI passed; trusted verification required`,
did not explain who should act or how. CI definitions can differ because
a contributor branch has older workflows, even when the PR only changes
application code, as in #14991.
### Does this PR introduce _any_ user-facing change?
Authors and reviewers see the cause, repository, workflow, target branch
and required PR-number input directly in the status. Trust requirements
remain unchanged.
### How was this patch tested?
- Resolver/publisher and retirement tests: 153 passed, zero failures or
skips.
- All script tests: 178 passed, 18 existing CVE tests skipped because yq
is unavailable, zero failures.
- Added publication/length coverage and scheduled migration coverage
verifying old hints are refreshed while new settled hints are not
repeatedly inspected or rewritten.
- Existing tests still verify pending trust results are not downgraded
by a delayed running observation. `git diff --check` passed.
---
.github/scripts/publish-ci-status.cjs | 8 ++++---
.github/scripts/tests/fork-ci.test.cjs | 39 +++++++++++++++++++++++++++++++---
.github/scripts/update-fork-ci.cjs | 5 +++--
3 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/.github/scripts/publish-ci-status.cjs
b/.github/scripts/publish-ci-status.cjs
index c8538f768b..3939b95389 100644
--- a/.github/scripts/publish-ci-status.cjs
+++ b/.github/scripts/publish-ci-status.cjs
@@ -61,7 +61,9 @@ async function publishStatus({ github, repo, sha, context,
state, description, t
// Waiting for a committer is not a failure of the contributor's change.
const NEEDS_ATTENTION = 'Fork CI needs attention';
-const TRUSTED_REQUIRED = 'Fork CI passed; trusted verification required';
+const LEGACY_TRUSTED_REQUIRED = 'Fork CI passed; trusted verification
required';
+const TRUSTED_REQUIRED = 'Fork CI passed; CI files differ from target branch.
' +
+ 'Committer: run Fork CI in apache/gravitino on that branch with this PR
number.';
function statusState(result) {
if (result.status !== 'completed') return 'pending';
@@ -72,7 +74,7 @@ function statusState(result) {
// Whether a published status reports a finished execution, including pending
trusted verification.
function statusCompleted(status) {
- return status.state !== 'pending' || status.description === TRUSTED_REQUIRED;
+ return status.state !== 'pending' || [TRUSTED_REQUIRED,
LEGACY_TRUSTED_REQUIRED].includes(status.description);
}
-module.exports = { NEEDS_ATTENTION, TRUSTED_REQUIRED, latestStatus,
parseRunUrl, publishStatus, runUrl, statusCompleted, statusState };
+module.exports = { NEEDS_ATTENTION, TRUSTED_REQUIRED, LEGACY_TRUSTED_REQUIRED,
latestStatus, parseRunUrl, publishStatus, runUrl, statusCompleted, statusState
};
diff --git a/.github/scripts/tests/fork-ci.test.cjs
b/.github/scripts/tests/fork-ci.test.cjs
index 267c614c7c..bf024a17e4 100644
--- a/.github/scripts/tests/fork-ci.test.cjs
+++ b/.github/scripts/tests/fork-ci.test.cjs
@@ -511,7 +511,7 @@ test('scheduled publication ignores poisoned cache state
and recomputes definiti
const { github, statuses } = publisherMock();
github.rest.git = serviceMock({ changed: true }).rest.git;
await update({ github, context: ctx, core, stateFile, sleep: async () => {}
});
- assert.equal(statuses[0].description, 'Fork CI passed; trusted verification
required');
+ assert.equal(statuses[0].description, TRUSTED_REQUIRED);
const workflow = await readFile(path.join(__dirname,
'../../workflows/fork-ci-status-update.yml'), 'utf8');
assert.ok(!workflow.includes('actions/cache/'));
}));
@@ -1289,7 +1289,7 @@ test('changed CI definitions stay pending, not red, until
trusted CI verifies th
await update({ github, context: ctx, core, sleep: async () => {} });
// Waiting for a committer is not a failure of the contributor's change.
assert.equal(statuses[0].state, 'pending');
- assert.equal(statuses[0].description, 'Fork CI passed; trusted verification
required');
+ assert.equal(statuses[0].description, TRUSTED_REQUIRED);
}));
test('CI edits mirror execution progress and failures without self-approving
success', async () => withPublisher(async ({ ctx, core }) => {
@@ -1298,7 +1298,7 @@ test('CI edits mirror execution progress and failures
without self-approving suc
['in_progress', null, 'pending', 'Fork CI is running'],
['completed', 'failure', 'failure', 'Failed: backend / test; re-run it in
your fork'],
['completed', 'cancelled', 'error', 'Fork CI cancelled; re-run it in your
fork'],
- ['completed', 'success', 'pending', 'Fork CI passed; trusted verification
required']]) {
+ ['completed', 'success', 'pending', TRUSTED_REQUIRED]]) {
const { github, statuses } = publisherMock({ rerun: { ...run(), status,
conclusion } });
github.rest.git = serviceMock({ changed: true }).rest.git;
await update({ github, context: ctx, core, sleep: async () => {} });
@@ -2316,3 +2316,36 @@ test('trusted rerun failures stay retryable until the
current summary identifies
}
}
});
+
+
+test('trusted verification hint explains the cause and recovery without
truncation', async () => withPublisher(async ({ ctx, core }) => {
+ const { github, statuses } = publisherMock();
+ github.rest.git = serviceMock({ changed: true }).rest.git;
+ await update({ github, context: ctx, core });
+ assert.equal(statuses[0].state, 'pending');
+ assert.equal(statuses[0].description, 'Fork CI passed; CI files differ from
target branch. ' +
+ 'Committer: run Fork CI in apache/gravitino on that branch with this PR
number.');
+ assert.ok(statuses[0].description.length <= 140);
+}));
+
+test('scheduled probes upgrade the old trust hint without repeatedly rewriting
the new hint', async () => withPublisher(async ({ ctx, core }) => {
+ ctx.eventName = 'schedule'; delete ctx.payload.inputs;
+ const recent = { ...pr(), updated_at: new Date().toISOString() };
+ for (const description of ['Fork CI passed; trusted verification required',
TRUSTED_REQUIRED]) {
+ const { github, statuses } = publisherMock({ latest: forkStatus('pending',
description) });
+ github.rest.git = serviceMock({ changed: true }).rest.git;
+ const listPulls = github.rest.pulls.list, paginate = github.paginate;
+ github.paginate = async (endpoint, args) => endpoint === listPulls ?
[recent] : paginate(endpoint, args);
+ github.rest.pulls.get = async () => ({ data: recent });
+ let inspected = false;
+ const getTree = github.rest.git.getTree;
+ github.rest.git.getTree = async args => { inspected = true; return
getTree(args); };
+ await update({ github, context: ctx, core, sleep: async () => {} });
+ assert.equal(inspected, description !== TRUSTED_REQUIRED);
+ assert.equal(statuses.length, description === TRUSTED_REQUIRED ? 0 : 1);
+ if (statuses.length) {
+ assert.equal(statuses[0].state, 'pending');
+ assert.equal(statuses[0].description, TRUSTED_REQUIRED);
+ }
+ }
+}));
diff --git a/.github/scripts/update-fork-ci.cjs
b/.github/scripts/update-fork-ci.cjs
index 489f03e7a3..dcda789fa1 100644
--- a/.github/scripts/update-fork-ci.cjs
+++ b/.github/scripts/update-fork-ci.cjs
@@ -14,7 +14,7 @@
*/
'use strict';
const { createService } = require('./fork-ci-status.cjs');
-const { NEEDS_ATTENTION, latestStatus, parseRunUrl, publishStatus, runUrl,
statusCompleted, statusState } = require('./publish-ci-status.cjs');
+const { NEEDS_ATTENTION, LEGACY_TRUSTED_REQUIRED, latestStatus, parseRunUrl,
publishStatus, runUrl, statusCompleted, statusState } =
require('./publish-ci-status.cjs');
const { retireCancelled } = require('./retire-fork-ci.cjs');
const RECENT_MS = 6 * 60 * 60 * 1000;
@@ -197,7 +197,8 @@ async function update({ github, context, core, sleep = ms
=> new Promise(resolve
// Legacy links have no context proof and are refreshed once. The
rewritten
// link restores cheap probing, including after a missed retarget
signal.
const sameBase = shown?.base_sha === pr.base.sha && shown?.base_ref
=== pr.base.ref;
- if (settled && (!shown || sameBase)) return;
+ // Refresh the old trust hint once so existing pending PRs receive
actionable instructions.
+ if (settled && (!shown || sameBase) && latest.description !==
LEGACY_TRUSTED_REQUIRED) return;
}
await refresh(pr);
});