chesnokoff commented on code in PR #13558:
URL: https://github.com/apache/ignite/pull/13558#discussion_r3949764860
##########
.github/workflows/check-protected-classes.yml:
##########
@@ -86,19 +90,38 @@ jobs:
&& (lines.includes(ORDER_IMPORT) || lines.includes(ORDER_PKG));
};
- const hits = [];
+ const hits = new Set();
for (const [path, ref] of revisions) {
if (path.endsWith('.java')
&& !path.startsWith('modules/core/src/test/resources/codegen/')
- && await isProtected(path, ref)) hits.push(path);
+ && await isProtected(path, ref)) hits.add(path);
}
- if (hits.length === 0) return;
+ const comments = await
github.paginate(github.rest.issues.listComments, {
+ owner, repo, issue_number: pr.number,
+ });
+ const existing = comments.find(c => c.body &&
c.body.includes(MARKER));
+
+ if (hits.size === 0) {
+ if (existing) {
+ await github.rest.issues.deleteComment({ owner, repo,
comment_id: existing.id });
+ }
+
+ try {
+ await github.rest.issues.removeLabel({
+ owner, repo, issue_number: pr.number, name: 'compatibility',
+ });
+ } catch (e) {
+ if (e.status !== 404) throw e;
+ }
+
+ return;
+ }
// File names come from the fork; render them as inert inline code
so they cannot inject
// markdown (backticks, @mentions, links) into content posted
under the bot's write token.
const safe = f => '`' + String(f).replace(/[`\r\n]/g, '') + '`';
- const list = hits.map(f => '- ' + safe(f)).join('\n');
+ const list = [...hits].sort().map(f => '- ' + safe(f)).join('\n');
Review Comment:
To make the output of set `hits` sorted
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]