Skip to content

fix labeler + automaticaly add to GH project#4037

Merged
SylvainJuge merged 36 commits intoelastic:mainfrom
SylvainJuge:pr-label-fix
Apr 9, 2025
Merged

fix labeler + automaticaly add to GH project#4037
SylvainJuge merged 36 commits intoelastic:mainfrom
SylvainJuge:pr-label-fix

Conversation

@SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Apr 3, 2025

  • fixes the agent-java label
  • automatically adds internal PRs to the project board in In Progress status and in current iteration with something reusable across projects.

Depends on elastic/oblt-actions#263 to be merged

@SylvainJuge SylvainJuge requested a review from v1v April 4, 2025 10:27
Comment on lines 20 to 24
uses: AlexanderWert/issue-labeler@32be4a3c3d8f009c2741af471994337c34b4cb6f # v2.3
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["agent-java"]
})
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/java-label.yml
enable-versioned-regex: 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[for reviewer] this part failed, so switching to the same pattern we have elsewhere for example in the android agent seem to work. Also, I wonder if we could/should replace the current version as it relies on Alex repository.

Comment on lines 39 to 62
- name: Check team membership for user
uses: elastic/[email protected]
id: checkUserMember
with:
github-org: "elastic"
github-user: ${{ github.actor }}
github-token: ${{ steps.get_token.outputs.token }}
username: ${{ github.actor }}
team: 'apm'
usernamesToExclude: |
apmmachine
dependabot
dependabot[bot]
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}

- name: Show team membership
run: |
echo "::debug::isTeamMember: ${{ steps.checkUserMember.outputs.isTeamMember }}"
echo "::debug::isExcluded: ${{ steps.checkUserMember.outputs.isExcluded }}"

- name: Add community and triage labels
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]' && github.actor != 'elastic-observability-automation[bot]'
uses: actions/github-script@v7
if: steps.checkUserMember.outputs.isTeamMember != 'true' && steps.checkUserMember.outputs.isExcluded != 'true'
uses: AlexanderWert/issue-labeler@32be4a3c3d8f009c2741af471994337c34b4cb6f # v2.3
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["community", "triage"]
})
- name: Add comment for community PR
if: contains(steps.is_elastic_member.outputs.result, 'false') && github.actor != 'dependabot[bot]' && github.actor != 'elastic-renovate-prod[bot]' && github.actor != 'elastic-observability-automation[bot]'
uses: wow-actions/auto-comment@2fc064c21cfb2505de3c5c10e1473b8eb7beca1a # v1.1.2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pullRequestOpened: |
👋 @{{ author }} Thanks a lot for your contribution!

It may take some time before we review a PR, so even if you don’t see activity for some time, it **does not** mean that we have forgotten about it.

Every once in a while we go through a process of prioritization, after which we are focussing on the tasks that were planned for the upcoming [milestone](https://github.com/elastic/apm-agent-java/milestones). The prioritization status is typically reflected through the PR labels. It could be pending triage, a candidate for a future milestone, or have a target milestone set to it.
- name: Assign new internal pull requests to project
uses: elastic/[email protected]
if: contains(steps.is_elastic_member.outputs.result, 'true') && github.event.pull_request
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/community-label.yml
enable-versioned-regex: 0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[for reviewer] this part is a copy-paste from android agent repo.

@SylvainJuge SylvainJuge changed the title wip issue/pr label/dispatch fix labeler + automaticaly add to GH project Apr 4, 2025
@SylvainJuge
Copy link
Member Author

draft PR to add those to global github actions and make it easier to reuse elastic/oblt-actions#260

@SylvainJuge SylvainJuge marked this pull request as draft April 4, 2025 14:45
@SylvainJuge SylvainJuge self-assigned this Apr 4, 2025
@SylvainJuge SylvainJuge marked this pull request as ready for review April 9, 2025 09:32
@SylvainJuge SylvainJuge requested a review from v1v April 9, 2025 12:07
@SylvainJuge SylvainJuge enabled auto-merge (squash) April 9, 2025 12:25
@SylvainJuge SylvainJuge merged commit ce2f9f7 into elastic:main Apr 9, 2025
13 checks passed
@SylvainJuge SylvainJuge deleted the pr-label-fix branch April 9, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants