Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: use beat_version as fallback if it's provided #1256

Merged
merged 3 commits into from
Jun 14, 2021

Conversation

mdelapenya
Copy link
Contributor

What does this PR do?

It uses the BEAT_VERSION variable as fallback when provided. For that reason, upstream jobs must provide the Beat version, as they must know in which version they want to run the tests.

On the same hand, we are simplifying the methods to calculate the paths, removing the need to pass a fallback version, as this is already calculated at the initialisation of the configuration/environment, within the InitVersions method.

Why is it important?

Builds triggered by Beats maintenance branches are not able to calculate the right paths to fetch binaries from GCP, and this is caused because the Beats version is a moving target that cannot be calculated without inspecting Beats code (libbeat/version/version.go). I.e., last 7.13 commit is using 7.13.2 as version, which created 7.13.2-SNAPSHOT artifacts in GCP.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

How to test this PR locally

git checkout 7.13.x
TAGS="fleet_mode_agent && install" GITHUB_CHECK_SHA1=ad5f805dd30118cba3748189ef03bb945c958628 TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true BEAT_VERSION=7.13.2-SNAPSHOT make -C e2e/_suites/fleet functional-test

Related issues

Follow-ups

We need to pass the BEAT_VERSION in the Beats' packaging job, reading from make get-version' appending -SNAPSHOT`. Will send a PR ASAP

@mdelapenya mdelapenya self-assigned this Jun 14, 2021
@mdelapenya mdelapenya requested a review from a team June 14, 2021 10:48
Comment on lines +138 to +139
artifactName := utils.BuildArtifactName(podName, common.BeatVersion, "linux", "amd64", "tar.gz", true)
imagePath, err := utils.FetchBeatsBinary(m.ctx, artifactName, podName, common.BeatVersion, utils.TimeoutFactor, true)
Copy link
Contributor Author

@mdelapenya mdelapenya Jun 14, 2021

Choose a reason for hiding this comment

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

These two lines are candidates to be merged into one method, as they are always called all together

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1256 opened

  • Start Time: 2021-06-14T10:48:35.643+0000

  • Duration: 22 min 16 sec

  • Commit: 50f54f9

Test stats 🧪

Test Results
Failed 0
Passed 202
Skipped 0
Total 202

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 202
Skipped 0
Total 202

Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

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

🥇 💯 Nice!

@mdelapenya mdelapenya marked this pull request as ready for review June 14, 2021 12:12
@mdelapenya mdelapenya merged commit 55156f1 into elastic:master Jun 14, 2021
mergify bot pushed a commit that referenced this pull request Jun 14, 2021
* fix: honour beat_version as fallback

* chore: simplify method, as the init versions already checks the beat version

* chore: simplify method even more

(cherry picked from commit 55156f1)

# Conflicts:
#	internal/utils/utils_test.go
mergify bot pushed a commit that referenced this pull request Jun 14, 2021
* fix: honour beat_version as fallback

* chore: simplify method, as the init versions already checks the beat version

* chore: simplify method even more

(cherry picked from commit 55156f1)

# Conflicts:
#	internal/utils/utils_test.go
mdelapenya added a commit that referenced this pull request Jun 14, 2021
…ded (#1260)

* fix: use beat_version as fallback if it's provided (#1256)

* fix: honour beat_version as fallback

* chore: simplify method, as the init versions already checks the beat version

* chore: simplify method even more

(cherry picked from commit 55156f1)

# Conflicts:
#	internal/utils/utils_test.go

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Jun 14, 2021
…ovided (#1261)

* fix: use beat_version as fallback if it's provided (#1256)

* fix: honour beat_version as fallback

* chore: simplify method, as the init versions already checks the beat version

* chore: simplify method even more

(cherry picked from commit 55156f1)

# Conflicts:
#	internal/utils/utils_test.go

* fix: resolve conflicts

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
@mdelapenya mdelapenya deleted the fix-fallback-versions branch August 20, 2021 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[7.13.x] Beats branches are failing
4 participants