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

Use version from MANIFEST_URL #274

Merged
merged 12 commits into from
Jun 26, 2024
Merged

Use version from MANIFEST_URL #274

merged 12 commits into from
Jun 26, 2024

Conversation

dliappis
Copy link
Contributor

This commit derives the version directly from the MANIFEST_URL env var rather than rely on StackVersion defined in Directory.Build.Props.

Closes #271

This commit derives the version directly from the MANIFEST_URL env var
rather than rely on `StackVersion` defined in `Directory.Build.Props`.

Closes #271
@dliappis dliappis added the enhancement New feature or request label Jun 19, 2024
@dliappis dliappis self-assigned this Jun 19, 2024
@dliappis dliappis force-pushed the honor-version-from-stack-url branch from 812d6e2 to db433c3 Compare June 19, 2024 14:03
@dliappis dliappis requested a review from alpar-t June 20, 2024 11:07
@dliappis
Copy link
Contributor Author

I believe the test failure is unrelated as described in #277

@dliappis dliappis marked this pull request as ready for review June 20, 2024 12:23
@dliappis dliappis requested review from a team as code owners June 20, 2024 12:23

if [ "$DRA_WORKFLOW" == "staging" ]; then
MANIFEST_URL=$(curl https://artifacts-"$DRA_WORKFLOW".elastic.co/beats/latest/"$VERSION".json | jq -r '.manifest_url')
else
MANIFEST_URL=$(curl https://artifacts-"$DRA_WORKFLOW".elastic.co/beats/latest/"$VERSION"-SNAPSHOT.json | jq -r '.manifest_url')
fi

# Retrieve version value
VERSION=$(curl -s --retry 5 --retry-delay 10 "$MANIFEST_URL" | jq -r '.version')
Copy link
Contributor

Choose a reason for hiding this comment

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

$VERSION is used above, before it's defined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed in af501a4


### After a patch release

Update version in `Directory.Build.props` in the branch for the related minor version (ex: https://github.com/elastic/elastic-stack-installers/pull/183).
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe Directory.Build.props should have a place-holder version like 0.0.0 to avoid confusion ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe Directory.Build.props should have a place-holder version like 0.0.0 to avoid confusion ?

Not sure I follow, in this PR we are completely removing the file Directory.Build.props as it doesn't seem to be needed anywhere. Additionally all references to manual tasks in the README file.

Do you think we still need to keep the file?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're all good, my bad. I was looking for a change that removes the property not the entire file, I didn't realise it only holds this one value.

@dliappis dliappis requested a review from alpar-t June 25, 2024 07:31
alpar-t
alpar-t previously approved these changes Jun 26, 2024
@dliappis
Copy link
Contributor Author

The latest CI test failures are related to #277

To facilitate testing, we relax the conditionals that control the
pipeline execution.

This commit will be reverted before merging.
@dliappis dliappis force-pushed the honor-version-from-stack-url branch from de857fc to 7662c03 Compare June 26, 2024 11:52
dliappis added 6 commits June 26, 2024 15:19
Now that we rely on MANIFEST_URL for the $VERSION, we don't need to have
logic whether it contains a -SNAPSHOT suffix; it's already correctly
defined in the manifest.
in order to test packaging from PRs, we honor an optional DRA_BRANCH
env var
@dliappis
Copy link
Contributor Author

dliappis commented Jun 26, 2024

A test simulating the way that unified release triggers this job has been successful: https://buildkite.com/elastic/elastic-stack-installers/builds/5498#019054b1-ae75-47ae-96df-df84aa5b7f20

I have now reverted 7662c03 and f3bc775 which was raised to help running the build in the same way as the unified release does.

@alpar-t do you mind taking another look? the only change since you LGTMed it last time is one bug fix:

@dliappis dliappis requested a review from alpar-t June 26, 2024 13:50
@dliappis dliappis merged commit b67ab1c into main Jun 26, 2024
2 of 3 checks passed
@dliappis dliappis deleted the honor-version-from-stack-url branch June 26, 2024 14:22
@dliappis
Copy link
Contributor Author

dliappis commented Jun 26, 2024

Needs to be backported to 8.14

Backported to 8.14: #280

dliappis added a commit that referenced this pull request Jun 26, 2024
This commit derives the version directly from the MANIFEST_URL env var
rather than rely on `StackVersion` defined in `Directory.Build.Props`.

Closes #271
dliappis added a commit that referenced this pull request Jun 26, 2024
This commit derives the version directly from the MANIFEST_URL env var
rather than rely on `StackVersion` defined in `Directory.Build.Props`.

Relates 271

(Backport of #274)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack installers build should honour version of the manifest
2 participants