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

Check if the beat version snapshot contains a git commit #1405

Closed
mdelapenya opened this issue Jul 29, 2021 · 5 comments · Fixed by #1406 or #1459
Closed

Check if the beat version snapshot contains a git commit #1405

mdelapenya opened this issue Jul 29, 2021 · 5 comments · Fixed by #1406 or #1459
Assignees
Labels
area:test Anything related to the Test automation priority:high Product teams are waiting on features to make progress on their roadmap requested-by:Automation size:S less than 1 day Team:Automation Label for the Observability productivity team triaged Triaged issues will end up in Backlog column in Robots GH Project

Comments

@mdelapenya
Copy link
Contributor

I think we need to improve the automated bump with removing the calculation of the BeatVersionBase, which comes including the hash:

v, err := utils.GetElasticArtifactVersion(BeatVersionBase)
if err != nil {
	log.WithFields(log.Fields{
		"error":   err,
		"version": BeatVersionBase,
	}).Fatal("Failed to get Beat base version, aborting")
}
BeatVersionBase = v

A possible change could be to carry the fallback version between checks, replacing the log.Fatal with log.Warn:

v, err := utils.GetElasticArtifactVersion(BeatVersionBase)
if err != nil {
	log.WithFields(log.Fields{
		"error":   err,
		"version": BeatVersionBase,
	}).Warn("Failed to get Beat base version, aborting")
} else {
	BeatVersionBase = v
}

@adam-stokes wdyt?

Originally posted by @mdelapenya in #1391 (comment)

@mdelapenya
Copy link
Contributor Author

After thinking about it, simply checking if the beat_version contains a git commit, reusing and building on top of what we already have for checking if a string is a git sha, we can verify if a version contains the sha (i.e. 8.0.0-abcdef-SNAPSHOT).

Then, we will be able to automatically merge the automated PRs from the bump-version

@mdelapenya mdelapenya added requested-by:Automation size:S less than 1 day Team:Automation Label for the Observability productivity team triaged Triaged issues will end up in Backlog column in Robots GH Project priority:high Product teams are waiting on features to make progress on their roadmap area:test Anything related to the Test automation labels Jul 29, 2021
@mdelapenya
Copy link
Contributor Author

Reopening because it's not fully complete: when downloading the elastic-agent (and any product) from https://artifacts-api.elastic.co/v1/search/%s/%s?x-elastic-no-kpi=true the binary is not found.

We need a way to get the download URL for the git-hashed version

@mdelapenya mdelapenya reopened this Jul 29, 2021
@mdelapenya
Copy link
Contributor Author

Reopening because it's not fully complete: when downloading the elastic-agent (and any product) from https://artifacts-api.elastic.co/v1/search/%s/%s?x-elastic-no-kpi=true the binary is not found.

We need a way to get the download URL for the git-hashed version

We have solved it with #1406, but it's not enough: each time we use the common.BeatVersion variable, we are exposed to the issue of appending the git sha, creating paths that don't exist

@adam-stokes
Copy link
Contributor

Just for my clarification, did this problem start happening after we implemented the automated bump-version functionality?

@mdelapenya
Copy link
Contributor Author

Yes, it's not happening on master yet, as we are not merging the automated PRs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:test Anything related to the Test automation priority:high Product teams are waiting on features to make progress on their roadmap requested-by:Automation size:S less than 1 day Team:Automation Label for the Observability productivity team triaged Triaged issues will end up in Backlog column in Robots GH Project
Projects
None yet
2 participants