Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions .github/workflows/bump-elastic-stack-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@ae3030ce1710c6496214fb1f8fd3bd9437b2a69d # v2.82.0

- 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

with:
command: --experimental apply --config .github/workflows/updatecli.d/bump-elastic-stack-snapshot.yml --values .github/workflows/updatecli.d/values.d/scm.yml
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel-id: "#ingest-notifications"
slack-message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
slack-send-when: "failure"
version-file: .tool-versions
env:
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

uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
env:
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@update-me-with-the-slack-team-to-be-poked` please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
35 changes: 8 additions & 27 deletions .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@ae3030ce1710c6496214fb1f8fd3bd9437b2a69d # v2.82.0

- name: Run Updatecli in Apply mode
run: updatecli --experimental apply --config .github/workflows/updatecli.d/${{ matrix.file }} --values .github/workflows/updatecli.d/values.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
- uses: elastic/oblt-actions/updatecli/run-and-notify@v1
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
command: --experimental apply --config .github/workflows/updatecli.d/${{ matrix.file }} --values .github/workflows/updatecli.d/values.d/scm.yml
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel-id: "#ingest-notifications"
slack-message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
slack-send-when: "failure"
version-file: .tool-versions
env:
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@update-me-with-the-slack-team-to-be-poked` please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 changes: 12 additions & 26 deletions .github/workflows/updatecli-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,24 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
- uses: elastic/oblt-actions/updatecli/run-and-notify@v1
with:
command: --experimental compose diff
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel-id: "#ingest-notifications"
slack-message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
slack-send-when: "failure"
version-file: .tool-versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: elastic/oblt-actions/updatecli/run@v1
- uses: elastic/oblt-actions/updatecli/run-and-notify@v1
with:
command: --experimental compose apply
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel-id: "#ingest-notifications"
slack-message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
slack-send-when: "failure"
version-file: .tool-versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ failure() }}
name: Report obsoleted branches (slack)
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
{
"channel": "#ingest-notifications",
"text": "${{ env.SLACK_MESSAGE }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.SLACK_MESSAGE }}"
}
}
]
}
env:
SLACK_MESSAGE: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@update-me-with-the-slack-team-to-be-poked` please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ scms:
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
branch: '{{ requiredEnv "BRANCH" }}'
commitusingapi: true
force: false

sources:
latestVersion:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/updatecli.d/bump-golang-7.17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ scms:
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).


actions:
beats:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/updatecli.d/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ scms:
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
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

commitusingapi: true
force: false

actions:
beats:
Expand Down
4 changes: 2 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pull_request_rules:
- closed
- and:
- label=automation
- head~=^updatecli_bump-elastic-stack
- head~=^updatecli_
- files~=^testing/environments/snapshot.*\.yml$
actions:
delete_head_branch:
Expand All @@ -106,7 +106,7 @@ pull_request_rules:
- closed
- and:
- label=automation
- head~=^updatecli_bump-golang-version
- head~=^updatecli_
- files~=^\.go-version$
actions:
delete_head_branch:
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updatecli v0.97.0
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