Skip to content

github-actions(updatecli): use oblt-actions, pin version and avoid diverging PRs#43743

Merged
v1v merged 4 commits intomainfrom
feature/use-oblt-actions-instead
Apr 29, 2025
Merged

github-actions(updatecli): use oblt-actions, pin version and avoid diverging PRs#43743
v1v merged 4 commits intomainfrom
feature/use-oblt-actions-instead

Conversation

@v1v
Copy link
Copy Markdown
Member

@v1v v1v commented Apr 7, 2025

Proposed commit message

This should avoid issues when the changes diverge and then PRs are closed:

Therefore, it will not update those PRs but keep the ones that are open.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Updatecli

I deleted the branch for #43744 then I ran:

GITHUB_TOKEN=$(gh auth token) \
  GITHUB_ACTOR=v1v \
  BRANCH=8.x \
  updatecli --experimental apply \
    --config .github/workflows/updatecli.d/bump-elastic-stack-snapshot.yml \
    --values .github/workflows/updatecli.d/values.d/scm.yml

CI

See

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 7, 2025
@botelastic
Copy link
Copy Markdown

botelastic Bot commented Apr 7, 2025

This pull request doesn't have a Team:<team> label.

@mergify mergify Bot assigned v1v Apr 7, 2025
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 7, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @v1v? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@v1v v1v added backport-7.17 Automated backport to the 7.17 branch with mergify backport-8.x Automated backport to the 8.x branch with mergify labels Apr 7, 2025
@v1v v1v marked this pull request as ready for review April 7, 2025 16:12
@v1v v1v requested review from a team as code owners April 7, 2025 16:12
@v1v v1v requested review from AndersonQ and VihasMakwana April 7, 2025 16:12

- name: Run Updatecli in Apply mode
run: updatecli --experimental apply --config .github/workflows/updatecli.d/bump-elastic-stack-snapshot.yml --values .github/workflows/updatecli.d/values.d/scm.yml
- uses: elastic/oblt-actions/updatecli/run-and-notify@v1
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We maintain elastic/oblt-actions so we can avoid the burden of bumping versions

BRANCH: ${{ matrix.branch }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

elastic/oblt-actions/updatecli/run-and-notify does the notification if any failures, DRY

username: '{{ requiredEnv "GITHUB_ACTOR" }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
branch: main
branch: '{{ .scm.branch }}'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

default to main, but let's avoid being hardcoded here, so we can use the config file locally

Comment thread .tool-versions
@@ -0,0 +1 @@
updatecli v0.97.0 No newline at end of file
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll create a follow-up to bump this version as we do in some other places

token: '{{ requiredEnv "GITHUB_TOKEN" }}'
branch: "7.17"
commitusingapi: true
force: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this what would prevent the force-push that closes the PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct, that's the alternative, already added to the description, but see this link:

This solves the problem partially, as it will not create any new updates with a new version either updating the existing open PR or creating a new of if an existing open PR exists.

I need to see if using an old version of updatecli, as mentioned at updatecli/updatecli#2211 (comment), reverts to the original approach (see https://github.com/elastic/beats/pull/41241/commits).

Copy link
Copy Markdown
Contributor

@ev1yehor ev1yehor left a comment

Choose a reason for hiding this comment

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

LGTM

@v1v v1v requested a review from a team April 22, 2025 09:40
@v1v v1v changed the title github-actions(updatecli): use oblt-actions, pin version and avoid divering PRs github-actions(updatecli): use oblt-actions, pin version and avoid diverging PRs Apr 22, 2025
@v1v v1v enabled auto-merge (squash) April 23, 2025 07:39
@v1v v1v requested a review from AndersonQ April 24, 2025 12:15
@AndersonQ
Copy link
Copy Markdown
Member

Looks good, I'll wait the conflicts to be fixed then I'll approve the PR

@v1v
Copy link
Copy Markdown
Member Author

v1v commented Apr 29, 2025

@AndersonQ , this is now ready 🙏

@v1v v1v merged commit 4849df4 into main Apr 29, 2025
11 checks passed
@v1v v1v deleted the feature/use-oblt-actions-instead branch April 29, 2025 12:37
mergify Bot pushed a commit that referenced this pull request Apr 29, 2025
…verging PRs (#43743)

(cherry picked from commit 4849df4)

# Conflicts:
#	.github/workflows/bump-elastic-stack-snapshot.yml
#	.github/workflows/bump-golang.yml
#	.github/workflows/updatecli-compose.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-7.17 Automated backport to the 7.17 branch with mergify backport-8.x Automated backport to the 8.x branch with mergify needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants