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

[Ops] Refactor env loading & fix agent-targeting rewrite #178320

Merged
merged 8 commits into from
Mar 12, 2024

Conversation

delanni
Copy link
Contributor

@delanni delanni commented Mar 8, 2024

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

@delanni
Copy link
Contributor Author

delanni commented Mar 8, 2024

/ci

@delanni
Copy link
Contributor Author

delanni commented Mar 8, 2024

/ci

1 similar comment
@delanni
Copy link
Contributor Author

delanni commented Mar 8, 2024

/ci

@delanni
Copy link
Contributor Author

delanni commented Mar 8, 2024

/ci

@delanni delanni changed the title [Ops] Fix agent-targeting rewrite [Ops] Refactor env loading & fix agent-targeting rewrite Mar 12, 2024
@delanni delanni marked this pull request as ready for review March 12, 2024 11:02
@delanni delanni requested a review from a team as a code owner March 12, 2024 11:02
@delanni delanni added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Operations Team label for Operations Team labels Mar 12, 2024
@elasticmachine
Copy link
Contributor

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

@delanni delanni merged commit a89fb9b into elastic:main Mar 12, 2024
8 of 15 checks passed
@delanni delanni removed the backport:skip This commit does not require backporting label Mar 12, 2024
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 12, 2024
@delanni delanni removed the backport:skip This commit does not require backporting label Mar 12, 2024
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 12, 2024
@delanni delanni added v8.13.1 and removed backport:skip This commit does not require backporting labels Mar 12, 2024
delanni added a commit to delanni/kibana that referenced this pull request Mar 12, 2024
)

## 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
Copy link
Contributor Author

delanni commented Mar 13, 2024

💔 Some backports could not be created

Status Branch Result
8.13
7.17 Conflict resolution was aborted by the user

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 178320

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 13, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@delanni
Copy link
Contributor Author

delanni commented Mar 19, 2024

💚 All backports created successfully

Status Branch Result
7.17

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

Questions ?

Please refer to the Backport tool documentation

delanni added a commit to delanni/kibana that referenced this pull request Mar 19, 2024
)

## 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
delanni added a commit that referenced this pull request Mar 19, 2024
) (#178533)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[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","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":["8.13"],"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,"state":"NOT_CREATED"}]}]
BACKPORT-->
delanni added a commit that 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-->
@kibanamachine kibanamachine added v7.17.19 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team v7.17.19 v8.13.0 v8.13.1 v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants