Skip to content

Commit 4204f87

Browse files
committed
.github/workflows/config-diff-post-comments.js: introduce "/config check ok" command
Currently, we use the "Check ceph config" CI check to remind users about any configuration changes that were detected in the PR. There's no easy way for the script to detect if the relevant docuemtations has been updated for the config change that was detected. Users might get confused to still see the CI check failing even after updating the relevant docs. We update the text message to help diffuse the confusion. If the users will still like to see the CI check go green - they can comment `/config check ok` and re-run the failed test. Signed-off-by: Naveen Naidu <[email protected]>
1 parent ee55715 commit 4204f87

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/scripts/config-diff-post-comment.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ module.exports = async ({ github, context, core, configDiff }) => {
1313
}
1414
);
1515

16+
// Check if any comment contains `/config check ok`
17+
const configCheckOkComment = comments.find(comment => comment.body.includes("/config check ok"));
18+
if (configCheckOkComment) {
19+
core.info("Found '/config check ok' comment. Returning with success.");
20+
return;
21+
}
22+
1623
const existingComment = comments.find(comment => comment.body.includes("### Config Diff Tool Output"));
1724

1825
// Do not create comment if there are no configuration changes
@@ -42,8 +49,8 @@ ${configDiff}
4249
\`\`\`
4350
4451
45-
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
46-
`;
52+
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
53+
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment \`/config check ok\` and re-run the test. `;
4754

4855
// List all files in the pull request
4956
core.info("Fetching list of files changed in the pull request...");
@@ -64,7 +71,7 @@ The above configuration changes are found in the PR. Please update the relevant
6471
core.info(`Annotating file: ${file.filename}`);
6572
// Show annotations only at the start of the file
6673
core.notice(
67-
`Configuration changes detected in ${file.filename}. Please update the release documentation if necessary.`,
74+
`Configuration changes detected in ${file.filename}. Please update the release documentation if necessary. Ignore if already done`,
6875
{
6976
title: "Configuration Change Detected",
7077
file: file.filename,

0 commit comments

Comments
 (0)