You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "slawekjaranowski (via GitHub)" <gi...@apache.org> on 2025/11/23 18:40:35 UTC
[PR] Milestones management on next development [maven-gh-actions-shared]
slawekjaranowski opened a new pull request, #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221
on next development version, we will do actions:
- create new next milestone
- close old one
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Milestones management on next development [maven-gh-actions-shared]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski merged PR #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Milestones management on next development [maven-gh-actions-shared]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on PR #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221#issuecomment-3569322517
example result:
https://github.com/apache/maven-war-plugin/actions/runs/19626624457
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Milestones management on next development [maven-gh-actions-shared]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on code in PR #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221#discussion_r2554817664
##########
.github/workflows/release-drafter.yml:
##########
@@ -98,3 +102,87 @@ jobs:
- name: Verify release drafter status
if: steps.release-drafter.outputs.id == ''
run: exit 1
+
+ milestones-managment:
+ name: Milestones Management
+ needs: detect-version
+ permissions:
+ # write permission is required to manage milestones
+ issues: write
+ runs-on: ubuntu-latest
+ # execute only on next development commits
+ if: >
+ needs.detect-version.outputs.version != '' &&
+ startsWith(github.event.head_commit.message , '[maven-release-plugin] prepare for next development iteration')
+
+ steps:
+ - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ CURRENT_VERSION: ${{ needs.detect-version.outputs.version }}
+ with:
+ script: |
+ const branch = context.ref.replace('refs/heads/', '');
+ const version = process.env.CURRENT_VERSION;
+
+ console.log('branch: ' + branch);
+ console.log('version: ' + version);
+
+ const milestones = await github.rest.issues.listMilestones({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ state: 'open'
+ });
+
+ console.log('All open milestones: ');
+ console.log(milestones.data);
+
+ var milestone;
+ if (milestones.data.length > 1) {
+ milestone = milestones.data.find(({description}) => description?.includes('branch: ' + branch));
+ } else {
+ milestone = milestones.data[0];
Review Comment:
ok, I will take here only when exactly one milestone will be available
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Milestones management on next development [maven-gh-actions-shared]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on PR #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221#issuecomment-3569217341
> This will be a great help I think! <3
>
> However I still think, we should consider to also add a GHA to constantly check if milestones and their descriptions are valid so PR can automatically assigned to a milestone. But this ofc not part in this PR - I only want to mentioned that I don't think this PR will solve all milestone issues
yes no solve all issues, in first step it help during releases - manual milestone management will be not needed
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Milestones management on next development [maven-gh-actions-shared]
Posted by "Bukama (via GitHub)" <gi...@apache.org>.
Bukama commented on code in PR #221:
URL: https://github.com/apache/maven-gh-actions-shared/pull/221#discussion_r2554678226
##########
.github/workflows/release-drafter.yml:
##########
@@ -98,3 +102,87 @@ jobs:
- name: Verify release drafter status
if: steps.release-drafter.outputs.id == ''
run: exit 1
+
+ milestones-managment:
+ name: Milestones Management
+ needs: detect-version
+ permissions:
+ # write permission is required to manage milestones
+ issues: write
+ runs-on: ubuntu-latest
+ # execute only on next development commits
+ if: >
+ needs.detect-version.outputs.version != '' &&
+ startsWith(github.event.head_commit.message , '[maven-release-plugin] prepare for next development iteration')
+
+ steps:
+ - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ CURRENT_VERSION: ${{ needs.detect-version.outputs.version }}
+ with:
+ script: |
+ const branch = context.ref.replace('refs/heads/', '');
+ const version = process.env.CURRENT_VERSION;
+
+ console.log('branch: ' + branch);
+ console.log('version: ' + version);
+
+ const milestones = await github.rest.issues.listMilestones({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ state: 'open'
+ });
+
+ console.log('All open milestones: ');
+ console.log(milestones.data);
+
+ var milestone;
+ if (milestones.data.length > 1) {
+ milestone = milestones.data.find(({description}) => description?.includes('branch: ' + branch));
+ } else {
+ milestone = milestones.data[0];
+ }
+
+ console.log('Current milestone: ');
+ console.log(milestone);
+
+ core.summary.addHeading('Milestone management');
+
+ // in first step just create new milestone - closing the old one will be in the next step
+ // if something fails here - we don't want to close the existing milestone
+ const resultNew = await github.rest.issues.createMilestone({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: version,
+ description: 'branch: ' + branch
+ });
+
+ console.log('Created new milestone: ');
+ console.log(resultNew.data);
+
+ core.summary.addRaw('New milestone: ');
+ core.summary.addLink(resultNew.data.title, resultNew.data.html_url);
+ core.summary.addBreak();
+
+ // now close the existing milestone
+ if (milestone) {
+ const resultOld = await github.rest.issues.updateMilestone({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ milestone_number: milestone.number,
+ state: 'closed'
+ });
+
+ console.log('Closed old milestone: ');
+ console.log(resultOld.data);
+
+ core.summary.addRaw('Closed milestone: ');
+ core.summary.addLink(milestone.title, milestone.html_url);
+ core.summary.addBreak();
+ } else {
+ console.log('No existing milestone to close');
+ core.summary.addRaw('No existing milestone to close - plese verify');
Review Comment:
please
##########
.github/workflows/release-drafter.yml:
##########
@@ -98,3 +102,87 @@ jobs:
- name: Verify release drafter status
if: steps.release-drafter.outputs.id == ''
run: exit 1
+
+ milestones-managment:
+ name: Milestones Management
+ needs: detect-version
+ permissions:
+ # write permission is required to manage milestones
+ issues: write
+ runs-on: ubuntu-latest
+ # execute only on next development commits
+ if: >
+ needs.detect-version.outputs.version != '' &&
+ startsWith(github.event.head_commit.message , '[maven-release-plugin] prepare for next development iteration')
+
+ steps:
+ - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ CURRENT_VERSION: ${{ needs.detect-version.outputs.version }}
+ with:
+ script: |
+ const branch = context.ref.replace('refs/heads/', '');
+ const version = process.env.CURRENT_VERSION;
+
+ console.log('branch: ' + branch);
+ console.log('version: ' + version);
+
+ const milestones = await github.rest.issues.listMilestones({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ state: 'open'
+ });
+
+ console.log('All open milestones: ');
+ console.log(milestones.data);
+
+ var milestone;
+ if (milestones.data.length > 1) {
+ milestone = milestones.data.find(({description}) => description?.includes('branch: ' + branch));
+ } else {
+ milestone = milestones.data[0];
Review Comment:
We have repositories with two milestones without descriptions, e.g. a `1.2.2` and a `1.3.0` milestones. I'm not sure which would be picked here.
(And yes this should not be / handled by having a 1.2.x branch and branch name in milestone and the 1.3.0-SNAPSHOT on master with master in name.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org