Skip to content

[CI] Add dev/codeowners and .go-version file to be synced in backport branches#13994

Merged
mrodm merged 6 commits intoelastic:mainfrom
mrodm:add_folder_to_backport_branch
May 26, 2025
Merged

[CI] Add dev/codeowners and .go-version file to be synced in backport branches#13994
mrodm merged 6 commits intoelastic:mainfrom
mrodm:add_folder_to_backport_branch

Conversation

@mrodm
Copy link
Collaborator

@mrodm mrodm commented May 23, 2025

Proposed commit message

This PR updates the script in charge of creating backport branches:

  • Add dev/codeowners folder to be synced in backport script too.
  • Add .go-version file to be synced in backport script too.
    • As it is run go mod tidy from main branch, go.mod file in the backport branch is updated taking into account that Golang version.
  • Update .github/CODEOWNERS file removing the paths of other packages if REMOVE_OTHER_PACKAGES variable is set to true.

Example backport buildkite build: https://buildkite.com/elastic/integrations-backport/builds/179#0196ff67-5173-426d-bf19-63f000a6921d

These changes creating a backport branch have been tested in this integrations PR: #13991

Related issues

@mrodm mrodm self-assigned this May 23, 2025
Comment on lines +105 to +107
currentPackage=$(basename "${dir}")
echo "Removing ${currentPackage} from .github/CODEOWNERS"
sed -i "/^\/packages\/${currentPackage}\//d" .github/CODEOWNERS
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Leave just in .github/CODEOWNERS the entries related to ${PACKAGE_NAME} package.

Comment on lines +161 to +163
echo "Copying $CODEOWNERS_SCRIPTS_FOLDER from $SOURCE_BRANCH..."
git checkout "$SOURCE_BRANCH" -- "${CODEOWNERS_SCRIPTS_FOLDER}"
git add ${CODEOWNERS_SCRIPTS_FOLDER}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New folder added dev/codeowners

Comment on lines +172 to +174
echo "Copying .go-version from $SOURCE_BRANCH..."
git checkout "$SOURCE_BRANCH" -- ".go-version"
git add .go-version
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New file added: .go-version

As this script is run with the contents of main branch, go.mod file in the backport branch is updated using the Golang version (.go-version) defined in main branch.

This ensures that backport branch is run with the same Golang version.

Tested that elastic-package v0.100.0 version worked with a newer Golang version in this build: #13991

@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@mrodm mrodm marked this pull request as ready for review May 26, 2025 13:24
@mrodm mrodm requested a review from a team as a code owner May 26, 2025 13:24
@mrodm mrodm merged commit 775e2fd into elastic:main May 26, 2025
8 checks passed
@mrodm mrodm deleted the add_folder_to_backport_branch branch May 26, 2025 16:47
anupratharamachandran pushed a commit to anupratharamachandran/integrations that referenced this pull request Jun 2, 2025
… branches (elastic#13994)

Sync in backport branches dev/codeowners folder, .go-version file 
and update .github/CODEOWNERS file to avoid failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants