Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Fix publish script #188027

Merged
merged 8 commits into from
Jul 16, 2024
Merged

[CI] Fix publish script #188027

merged 8 commits into from
Jul 16, 2024

Conversation

delanni
Copy link
Contributor

@delanni delanni commented Jul 10, 2024

Summary

Another attempt to fix the DRY_RUN-enhanced publish call - as it seems simply emitting the script only works if there are no arguments.

Fixes: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9
Tested here: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the dry-run is supposedly added? but it seems the artifacts were published nonetheless - at least there's no more syntax error)

Succesful run with the if-else: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516

@delanni delanni added Team:Operations Team label for Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting skip-ci labels Jul 10, 2024
@delanni delanni marked this pull request as ready for review July 11, 2024 02:00
@delanni delanni requested a review from a team as a code owner July 11, 2024 02:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@jbudz
Copy link
Member

jbudz commented Jul 11, 2024

Tested here: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the dry-run is supposedly added? but it seems the artifacts were published nonetheless - at least there's no more syntax error)

It skipped the upload step, but ran all the other checks. That part LGTM. https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4493#0190a178-4260-48df-a84a-cc2f515c0603/339-379

fi

"${PUBLISH_CMD[@]}"
eval "$PUBLISH_CMD"
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we can construct the flags and pass that to the docker command without eval at the end, or similar? I'm hesitant to run eval against so many environment variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, that's probably an option, I didn't consider that

Copy link
Contributor Author

@delanni delanni Jul 16, 2024

Choose a reason for hiding this comment

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

Without the eval, the command line seems to struggle with quotes, and I can't seem to nail the right way of setting the args up, see my attempts: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds?branch=fix-publish-script

I've finally settled to have a very basic if/else branch here: 979b44a => https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516

@delanni delanni added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Jul 16, 2024
@delanni delanni requested a review from jbudz July 16, 2024 09:56
@delanni delanni merged commit 9d75f32 into main Jul 16, 2024
8 checks passed
@delanni delanni deleted the fix-publish-script branch July 16, 2024 14:14
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.15 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 188027

Questions ?

Please refer to the Backport tool documentation

delanni added a commit to delanni/kibana that referenced this pull request Jul 16, 2024
## Summary
Another attempt to fix the DRY_RUN-enhanced publish call - as it seems
simply emitting the script only works if there are no arguments.

Fixes:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9
Tested here:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the
dry-run is supposedly added? but it seems the artifacts were published
nonetheless - at least there's no more syntax error)

Succesful run with the if-else:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516

(cherry picked from commit 9d75f32)

# Conflicts:
#	.buildkite/scripts/steps/artifacts/publish.sh
delanni added a commit to delanni/kibana that referenced this pull request Jul 16, 2024
## Summary
Another attempt to fix the DRY_RUN-enhanced publish call - as it seems
simply emitting the script only works if there are no arguments.

Fixes:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9
Tested here:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the
dry-run is supposedly added? but it seems the artifacts were published
nonetheless - at least there's no more syntax error)

Succesful run with the if-else:
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516

(cherry picked from commit 9d75f32)

# Conflicts:
#	.buildkite/scripts/steps/artifacts/publish.sh
@delanni
Copy link
Contributor Author

delanni commented Jul 16, 2024

💚 All backports created successfully

Status Branch Result
8.15
8.14

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

delanni added a commit that referenced this pull request Jul 16, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[CI] Fix publish script
(#188027)](#188027)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-16T14:14:06Z","message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","skip-ci","backport:prev-minor","v8.16.0"],"number":188027,"url":"https://github.com/elastic/kibana/pull/188027","mergeCommit":{"message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188027","number":188027,"mergeCommit":{"message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a"}}]}]
BACKPORT-->
delanni added a commit that referenced this pull request Jul 16, 2024
# Backport

This will backport the following commits from `main` to `8.14`:
- [[CI] Fix publish script
(#188027)](#188027)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-16T14:14:06Z","message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","skip-ci","backport:prev-minor","v8.16.0"],"number":188027,"url":"https://github.com/elastic/kibana/pull/188027","mergeCommit":{"message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188027","number":188027,"mergeCommit":{"message":"[CI]
Fix publish script (#188027)\n\n## Summary\r\nAnother attempt to fix the
DRY_RUN-enhanced publish call - as it seems\r\nsimply emitting the
script only works if there are no
arguments.\r\n\r\nFixes:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9\r\nTested
here:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490
(the\r\ndry-run is supposedly added? but it seems the artifacts were
published\r\nnonetheless - at least there's no more syntax
error)\r\n\r\nSuccesful run with the
if-else:\r\nhttps://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516","sha":"9d75f32f422c641fd6560a7e562303cb7935c98a"}}]}]
BACKPORT-->
delanni added a commit that referenced this pull request Jul 16, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 16, 2024
## Summary
Last fix on elastic#188027

(cherry picked from commit 9d43b39)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 16, 2024
## Summary
Last fix on elastic#188027

(cherry picked from commit 9d43b39)
kibanamachine added a commit that referenced this pull request Jul 16, 2024
# Backport

This will backport the following commits from `main` to `8.14`:
- [[CI] fix unbound variable issue
(#188454)](#188454)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-16T16:11:11Z","message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","skip-ci","backport:auto-version","v8.15.0","v8.16.0","v8.14.4"],"title":"[CI]
fix unbound variable
issue","number":188454,"url":"https://github.com/elastic/kibana/pull/188454","mergeCommit":{"message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7"}},"sourceBranch":"main","suggestedTargetBranches":["8.15","8.14"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188454","number":188454,"mergeCommit":{"message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7"}},{"branch":"8.14","label":"v8.14.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <[email protected]>
kibanamachine added a commit that referenced this pull request Jul 16, 2024
# Backport

This will backport the following commits from `main` to `8.15`:
- [[CI] fix unbound variable issue
(#188454)](#188454)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-16T16:11:11Z","message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","skip-ci","backport:auto-version","v8.15.0","v8.16.0","v8.14.4"],"title":"[CI]
fix unbound variable
issue","number":188454,"url":"https://github.com/elastic/kibana/pull/188454","mergeCommit":{"message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7"}},"sourceBranch":"main","suggestedTargetBranches":["8.15","8.14"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188454","number":188454,"mergeCommit":{"message":"[CI]
fix unbound variable issue (#188454)\n\n## Summary\r\nLast fix on
#188027","sha":"9d43b39f47433f4f635105872886f77e912398e7"}},{"branch":"8.14","label":"v8.14.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alex Szabo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes skip-ci Team:Operations Team label for Operations Team v8.14.4 v8.15.0 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants