You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "chesnokoff (via GitHub)" <gi...@apache.org> on 2026/09/07 12:31:09 UTC

[PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

chesnokoff opened a new pull request, #13558:
URL: https://github.com/apache/ignite/pull/13558

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot - Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 2](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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@ignite.apache.org

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


Re: [PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

Posted by "chesnokoff (via GitHub)" <gi...@apache.org>.
chesnokoff commented on code in PR #13558:
URL: https://github.com/apache/ignite/pull/13558#discussion_r3949758999


##########
.github/workflows/check-protected-classes.yml:
##########
@@ -108,14 +131,12 @@ jobs:
             ].join('\n');
             const body = MARKER + '\n## Possible compatibility issues. Please, check rolling upgrade cases\n\n' + summary + '\n';
 
-            const comments = await github.paginate(github.rest.issues.listComments, {
-              owner, repo, issue_number: pr.number,
-            });
-            const existing = comments.find(c => c.body.includes(MARKER));
             if (existing) {
-              await github.rest.issues.deleteComment({ owner, repo, comment_id: existing.id });
+              await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body });

Review Comment:
   Previous implementation deleted comment and created it again. Now it updates the existing 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@ignite.apache.org

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


Re: [PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

Posted by "chesnokoff (via GitHub)" <gi...@apache.org>.
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 `hist` 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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

Posted by "chesnokoff (via GitHub)" <gi...@apache.org>.
chesnokoff commented on code in PR #13558:
URL: https://github.com/apache/ignite/pull/13558#discussion_r3949750989


##########
.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();

Review Comment:
   Replaced to set to not count same protected file twice



-- 
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@ignite.apache.org

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


Re: [PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

Posted by "chesnokoff (via GitHub)" <gi...@apache.org>.
chesnokoff commented on code in PR #13558:
URL: https://github.com/apache/ignite/pull/13558#discussion_r3949746719


##########
.github/workflows/check-protected-classes.yml:
##########
@@ -53,13 +53,17 @@ jobs:
 
             // Reproduce `git diff --no-renames --diff-filter=ADM`: a rename is a delete(old)+add(new) pair.
             // A protected class carries the @Order annotation; an added file is defined by the head revision,
-            // a deleted/modified one by the base.
+            // a deleted one by the base, and a modified one must be checked in both revisions.
             const revisions = [];
             for (const f of files) {
               if (f.status === 'added' || f.status === 'copied')
                 revisions.push([f.filename, headSha]);
-              else if (f.status === 'removed' || f.status === 'modified' || f.status === 'changed')
+              else if (f.status === 'removed')
                 revisions.push([f.filename, baseSha]);
+              else if (f.status === 'modified' || f.status === 'changed') {
+                revisions.push([f.filename, baseSha]);
+                revisions.push([f.filename, headSha]);
+              }

Review Comment:
   Check protected class before and after change



-- 
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@ignite.apache.org

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


Re: [PR] IGNITE-28966 Fix protected classes workflow cleanup [ignite]

Posted by "chesnokoff (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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