Skip to content

Conversation

@jsoriano
Copy link
Member

Add github action to automate bump of stack versions.

It bumps:

  • Latest snapshot build for 8.x.
  • Latest snapshot build for 7.17.x.
  • Stack default version.
  • Package Registry version.
@jsoriano jsoriano self-assigned this May 23, 2024
@jsoriano
Copy link
Member Author

@mrodm do you know if there is any way to test these actions before merging?

@jsoriano jsoriano requested a review from a team May 23, 2024 12:57
@mrodm
Copy link
Contributor

mrodm commented May 23, 2024

@mrodm do you know if there is any way to test these actions before merging?

I think of two options

  • Create first a PR with a minimal Github workflow, and then triggering from UI the Github Workflow from your branch

  • Try to use gh. Not tested, but it would be worth to try it: https://cli.github.com/manual/gh_workflow_run

    Within the elastic-pacakge repository:

    gh workflow run bump-elastic-stack-version -r `your branch`

Not sure if it requires to create this PR in the upstream repository because of this:
https://github.com/elastic/elastic-package/pull/1853/files#diff-cf638fce84d5cc76017b884e67009ea1e65b57e9dd6f2ec2f3de859c1f0bcbdaR30

Comment on lines 14 to 16
- backport-skip
- build-monitoring
- Team:Beats-On-Call
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say these three labels are not needed in elastic-package PRs.

permissions:
contents: write
pull-requests: write
needs: [filter]
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no jobs filter defined. Probably, this job fails or could not start. Is it required another job here ?

I guess it is probably based on this workflow: https://github.com/elastic/beats/blob/d23b4d33622137f7245b628d77d15f8ecfef3a0d/.github/workflows/bump-elastic-stack-snapshot.yml#L16

Currently, the filter job looks like would not be needed. If so, this could be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, this is a leftover from copying from beats.

@jsoriano
Copy link
Member Author

jsoriano commented May 23, 2024

This doesn't seem to work, I have tried different options but it doesn't seem to find the workflow.

Not sure if it requires to create this PR in the upstream repository because of this: https://github.com/elastic/elastic-package/pull/1853/files#diff-cf638fce84d5cc76017b884e67009ea1e65b57e9dd6f2ec2f3de859c1f0bcbdaR30

Tried in #1854, but no luck.

Create first a PR with a minimal Github workflow, and then triggering from UI the Github Workflow from your branch

I have modified the workflow in this PR to show only the diff and don't apply the changes, let me know if this is ok for you. We could merge this and change to apply after testing in a different PR.

@jsoriano jsoriano marked this pull request as ready for review May 23, 2024 15:33
@jsoriano jsoriano requested a review from mrodm May 23, 2024 15:37
@mrodm
Copy link
Contributor

mrodm commented May 23, 2024

This doesn't seem to work, I have tried different options but it doesn't seem to find the workflow.

So at the end, it looks like it should be defined in main... I cannot think of any other ways to test this without merging.

I have modified the workflow in this PR to show only the diff and don't apply the changes, let me know if this is ok for you. We could merge this and change to apply after testing in a different PR.

Perfect, let's do it in that way 👍

Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

These workflows looks good, let's merge it and try it 👍

Comment on lines +83 to +91
update-package-registry-base-image:
name: "Update Package Registry base image"
kind: file
sourceid: latestRegistryVersion
scmid: default
spec:
file: internal/stack/resources.go
matchpattern: '"(docker.elastic.co/package-registry/package-registry):v[0-9\.]+"'
replacepattern: '"$1:{{ source "latestRegistryVersion" }}"'
Copy link
Contributor

Choose a reason for hiding this comment

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

If this works, we could remove the step to create this PR from other Buildkite job.

@jsoriano jsoriano enabled auto-merge (squash) May 23, 2024 16:05
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

@jsoriano jsoriano merged commit 5f170a4 into elastic:main May 23, 2024
@jsoriano
Copy link
Member Author

I can test changes in the workflow now that it is in main 👍

@jsoriano jsoriano deleted the bump-stack-versions.yml branch May 23, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants