Skip to content

fix(ci): Provide correct build info for release builds #15939

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

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Jan 24, 2025

What this PR does / why we need it:

Then building a binary or image release for an upcoming version from a release branch, we provide the version using --build-arg IMAGE_TAG=... in the Docker build step of the CI workflow (ref).

However, this argument was ignored in the Dockerfile and not further passed down to the make ... command inside build phase of the Dockerfile.

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
Then building a binary or image release for an upcoming version from a
release branch, we provide it as IMAGE_TAG as --build-arg.

However, this argument was ignored in the Dockerfile and not further
passed down to the `make ...` command inside the Docker build phase.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@chaudum chaudum force-pushed the chaudum/fix-build-info branch from 11285a9 to 103b5c3 Compare January 27, 2025 07:24
@chaudum chaudum marked this pull request as ready for review January 27, 2025 07:24
@chaudum chaudum requested a review from a team as a code owner January 27, 2025 07:24
@chaudum chaudum changed the title fix: Provide correct build info for release builds Jan 28, 2025
@chaudum chaudum requested a review from DylanGuedes January 28, 2025 11:11
@chaudum chaudum merged commit 625bdab into main Jan 28, 2025
58 checks passed
@chaudum chaudum deleted the chaudum/fix-build-info branch January 28, 2025 12:15
@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Feb 10, 2025

Hello @paul1r!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Feb 10, 2025

The backport to release-3.3.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-15939-to-release-3.3.x origin/release-3.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 625bdabce91f1043065b582052b2c3558c9af0e6

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-15939-to-release-3.3.x
# Create the PR body template
PR_BODY=$(gh pr view 15939 --json body --template 'Backport 625bdabce91f1043065b582052b2c3558c9af0e6 from #15939{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title 'fix(ci): Provide correct build info for release builds (backport release-3.3.x)' --body-file - --label 'size/S' --label 'backport' --label 'type/ci' --base release-3.3.x --milestone release-3.3.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-15939-to-release-3.3.x

# Create a pull request where the `base` branch is `release-3.3.x` and the `compare`/`head` branch is `backport-15939-to-release-3.3.x`.

# Remove the local backport branch
git switch main
git branch -D backport-15939-to-release-3.3.x
@paul1r paul1r mentioned this pull request Feb 10, 2025
6 tasks
salvacorts pushed a commit that referenced this pull request Feb 12, 2025
Then building a binary or image release for an upcoming version from a release branch, we provide the version using `--build-arg IMAGE_TAG=...` in the Docker build step of the CI workflow ([ref](https://github.com/grafana/loki/blob/3df08bd39f45bbf8314f31a59f35b955b9a31a5e/.github/workflows/minor-release-pr.yml#L456)).

However, this argument was ignored in the Dockerfile and not further passed down to the `make ...` command inside build phase of the Dockerfile.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
(cherry picked from commit 625bdab)
ashwanthgoli pushed a commit that referenced this pull request Feb 12, 2025
Co-authored-by: Christian Haudum <christian.haudum@gmail.com>
salvacorts pushed a commit that referenced this pull request Feb 12, 2025
Then building a binary or image release for an upcoming version from a release branch, we provide the version using `--build-arg IMAGE_TAG=...` in the Docker build step of the CI workflow ([ref](https://github.com/grafana/loki/blob/3df08bd39f45bbf8314f31a59f35b955b9a31a5e/.github/workflows/minor-release-pr.yml#L456)).

However, this argument was ignored in the Dockerfile and not further passed down to the `make ...` command inside build phase of the Dockerfile.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
(cherry picked from commit 625bdab)
salvacorts pushed a commit that referenced this pull request Feb 12, 2025
Then building a binary or image release for an upcoming version from a release branch, we provide the version using `--build-arg IMAGE_TAG=...` in the Docker build step of the CI workflow ([ref](https://github.com/grafana/loki/blob/3df08bd39f45bbf8314f31a59f35b955b9a31a5e/.github/workflows/minor-release-pr.yml#L456)).

However, this argument was ignored in the Dockerfile and not further passed down to the `make ...` command inside build phase of the Dockerfile.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
# Conflicts:
#	clients/cmd/promtail/Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment