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

[8.13] [Ops] Refactor env loading & fix agent-targeting rewrite (#178320) #178533

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

delanni
Copy link
Contributor

@delanni delanni commented Mar 12, 2024

Backport

This will backport the following commits from main to 8.13:

Questions ?

Please refer to the Backport tool documentation

)

## Summary
This PR refactors a bit of the pre-command env setup, separating parts,
so they can be individually skipped. Then it removes the setup-avoidance
based on agent types, as this won't be useful after the migration.

Also, it fixes a missed bit in the agent-targeting rewrite used for the
migration, where the `provider: 'gcp'` was missing, and adds an optional
targeting for the script.

- add gcp as provider to all rewritten agent targeting rules
- add option to target specific pipelines
- refactor env-var loading to a separated file
- refactor node installs so it can be switched by a flag
- skip node installing in (some) jobs that don't require it

(cherry picked from commit a89fb9b)

# Conflicts:
#	.buildkite/scripts/lifecycle/pre_command.sh
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@delanni delanni requested a review from a team March 19, 2024 16:33
@delanni
Copy link
Contributor Author

delanni commented Mar 19, 2024

Includes this revert: 4a14463

@delanni delanni merged commit 87f05fd into elastic:8.13 Mar 19, 2024
18 checks passed
delanni referenced this pull request Mar 20, 2024
) (#178959)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[Ops] Refactor env loading & fix agent-targeting rewrite
(#178320)](#178320)

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

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

<!--BACKPORT [{"author":{"name":"Alex
Szabo","email":"alex.szabo@elastic.co"},"sourceCommit":{"committedDate":"2024-03-12T15:31:26Z","message":"[Ops]
Refactor env loading & fix agent-targeting rewrite (#178320)\n\n##
Summary\r\nThis PR refactors a bit of the pre-command env setup,
separating parts,\r\nso they can be individually skipped. Then it
removes the setup-avoidance\r\nbased on agent types, as this won't be
useful after the migration.\r\n\r\nAlso, it fixes a missed bit in the
agent-targeting rewrite used for the\r\nmigration, where the `provider:
'gcp'` was missing, and adds an optional\r\ntargeting for the
script.\r\n\r\n- add gcp as provider to all rewritten agent targeting
rules\r\n- add option to target specific pipelines\r\n- refactor env-var
loading to a separated file\r\n- refactor node installs so it can be
switched by a flag\r\n- skip node installing in (some) jobs that don't
require
it","sha":"a89fb9b2fbb73742808fa419aaf98486c31d921d","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport
missing","v8.14.0","v8.13.1"],"number":178320,"url":"https://github.com/elastic/kibana/pull/178320","mergeCommit":{"message":"[Ops]
Refactor env loading & fix agent-targeting rewrite (#178320)\n\n##
Summary\r\nThis PR refactors a bit of the pre-command env setup,
separating parts,\r\nso they can be individually skipped. Then it
removes the setup-avoidance\r\nbased on agent types, as this won't be
useful after the migration.\r\n\r\nAlso, it fixes a missed bit in the
agent-targeting rewrite used for the\r\nmigration, where the `provider:
'gcp'` was missing, and adds an optional\r\ntargeting for the
script.\r\n\r\n- add gcp as provider to all rewritten agent targeting
rules\r\n- add option to target specific pipelines\r\n- refactor env-var
loading to a separated file\r\n- refactor node installs so it can be
switched by a flag\r\n- skip node installing in (some) jobs that don't
require
it","sha":"a89fb9b2fbb73742808fa419aaf98486c31d921d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.14.0","labelRegex":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/178320","number":178320,"mergeCommit":{"message":"[Ops]
Refactor env loading & fix agent-targeting rewrite (#178320)\n\n##
Summary\r\nThis PR refactors a bit of the pre-command env setup,
separating parts,\r\nso they can be individually skipped. Then it
removes the setup-avoidance\r\nbased on agent types, as this won't be
useful after the migration.\r\n\r\nAlso, it fixes a missed bit in the
agent-targeting rewrite used for the\r\nmigration, where the `provider:
'gcp'` was missing, and adds an optional\r\ntargeting for the
script.\r\n\r\n- add gcp as provider to all rewritten agent targeting
rules\r\n- add option to target specific pipelines\r\n- refactor env-var
loading to a separated file\r\n- refactor node installs so it can be
switched by a flag\r\n- skip node installing in (some) jobs that don't
require
it","sha":"a89fb9b2fbb73742808fa419aaf98486c31d921d"}},{"branch":"8.13","label":"v8.13.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/178533","number":178533,"state":"OPEN"}]}]
BACKPORT-->
@delanni delanni deleted the backport/8.13/pr-178320 branch March 20, 2024 12:37
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.

3 participants