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

Feature/introduce version package #2750

Merged
merged 3 commits into from
May 31, 2023

Conversation

pchila
Copy link
Contributor

@pchila pchila commented May 31, 2023

What does this PR do?

Introduce semver-compliant version package to be used for upgrade to specific snapshot build.

Why is it important?

We need a way to parse correctly versions like x.y.z-SNAPSHOT+buildID, since the code is small enough I chose to introduce our own version package so that we can tailor it to our release name conventions if we need to (snapshot, emergency releases etc.)
We also removed a direct dependency on an external library by adding ~160 lines of code which is not too bad since it comes with the advantage of full control over the version parsing for elastic agent

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 added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@pchila pchila self-assigned this May 31, 2023
@pchila pchila requested a review from a team as a code owner May 31, 2023 09:51
@mergify
Copy link
Contributor

mergify bot commented May 31, 2023

This pull request does not have a backport label. Could you fix it @pchila? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@pchila pchila requested review from ycombinator and removed request for AndersonQ May 31, 2023 09:52
@pchila pchila added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent Label for the Agent team skip-changelog labels May 31, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 31, 2023

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2023-05-31T17:13:35.211+0000

  • Duration: 21 min 9 sec

Test stats 🧪

Test Results
Failed 0
Passed 5795
Skipped 19
Total 5814

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

elasticmachine commented May 31, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.63% (72/73) 👍 0.019
Files 68.4% (171/250) 👍 0.127
Classes 67.019% (317/473) 👎 -0.002
Methods 53.838% (968/1798) 👍 0.16
Lines 39.603% (11092/28008) 👍 0.121
Conditionals 100.0% (0/0) 💚

@pchila pchila mentioned this pull request May 31, 2023
7 tasks
Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

Could you include the removal of the github.com/Masterminds/semver module and any associated changes in this PR? That way, before and after this PR, we only have one way to parse and work with versions in the EA codebase. Thanks!

@pchila pchila merged commit 14b7fbd into elastic:main May 31, 2023
21 of 22 checks passed
@ycombinator ycombinator added backport-v8.8.0 Automated backport with mergify and removed backport-skip labels Jun 9, 2023
mergify bot pushed a commit that referenced this pull request Jun 9, 2023
* Parse version as semver

* make versions comparable and sortable

* use internal parsed semver package for upgrade integration tests

(cherry picked from commit 14b7fbd)
@ycombinator
Copy link
Contributor

This new package is being used in integration/E2E tests and we're backporting those to 8.8. So backporting this PR here here to 8.8 as well.

ycombinator pushed a commit that referenced this pull request Jun 9, 2023
* Parse version as semver

* make versions comparable and sortable

* use internal parsed semver package for upgrade integration tests

(cherry picked from commit 14b7fbd)

Co-authored-by: Paolo Chilà <paolo.chila@elastic.co>
@pchila pchila deleted the feature/introduce-version-package branch November 23, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.8.0 Automated backport with mergify skip-changelog Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants