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

fix(ci): Add Rust environment variables to Docker test workflows #9318

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gustavovalverde
Copy link
Member

@gustavovalverde gustavovalverde commented Mar 10, 2025

Motivation

It's hard to debug tests if we don't have access to the full backtrace and other options are expected to be set by our GitHub variables, but in the end not all of those are being fully used at runtime.

Solution

Enhance test workflows by adding Rust-specific environment variables:

  • Include RUST_LOG for logging configuration
  • Add RUST_BACKTRACE and RUST_LIB_BACKTRACE for improved error tracing
  • Include COLORBT_SHOW_HIDDEN for detailed backtraces
  • Add CARGO_INCREMENTAL for build performance optimization

This also fixes user creation issues in the Dockerfile:

  • Move WORKDIR after user creation to prevent home directory ownership issues
  • Properly set environment variables for UID, GID, HOME, and USER in each stage
  • Reorganize Dockerfile to ensure home directory is created after user setup
  • Fix interactive prompts during adduser by ensuring proper directory ownership

Tests

  • Existing non-failing tests should run as expected

Follow-up Work

  • Track the Test All issue

PR Checklist

  • The PR name is suitable for the release notes.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.
  • If the PR shouldn't be in the release notes, it has the
    C-exclude-from-changelog label.

Enhance test workflows by adding Rust-specific environment variables:
- Include RUST_LOG for logging configuration
- Add RUST_BACKTRACE and RUST_LIB_BACKTRACE for improved error tracing
- Include COLORBT_SHOW_HIDDEN for detailed backtraces
- Add CARGO_INCREMENTAL for build performance optimization

These changes improve debugging capabilities and provide more flexibility in test environments across dockerized CI jobs.
@gustavovalverde gustavovalverde requested a review from a team as a code owner March 10, 2025 10:19
@gustavovalverde gustavovalverde requested review from oxarbitrage and removed request for a team March 10, 2025 10:19
@gustavovalverde gustavovalverde self-assigned this Mar 10, 2025
@gustavovalverde gustavovalverde marked this pull request as draft March 10, 2025 10:19
@github-actions github-actions bot added the C-feature Category: New features label Mar 10, 2025
@gustavovalverde gustavovalverde added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement I-usability Zebra is hard to understand or use P-High 🔥 and removed C-feature Category: New features labels Mar 10, 2025
Enable configurable Rust incremental compilation in Docker builds by:
- Adding CARGO_INCREMENTAL as a build argument in GitHub Actions workflow
- Setting a default value of 0 in Dockerfile to control build performance
- Integrating with existing Rust environment variable configuration

This change provides more granular control over Rust compilation strategies in containerized builds.
- Move WORKDIR after user creation to prevent home directory ownership issues
- Properly set environment variables for UID, GID, HOME, and USER in each stage
- Reorganize Dockerfile to ensure home directory is created after user setup
- Fix interactive prompts during adduser by ensuring proper directory ownership
@gustavovalverde gustavovalverde added the C-exclude-from-changelog Category: The PR should be excluded from the changelog and release notes label Mar 10, 2025
@gustavovalverde gustavovalverde marked this pull request as ready for review March 10, 2025 13:13
@gustavovalverde gustavovalverde changed the title feat(ci): Add Rust environment variables to Docker test workflows fix(ci): Add Rust environment variables to Docker test workflows Mar 10, 2025
@gustavovalverde gustavovalverde requested a review from upbqdn March 10, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement C-exclude-from-changelog Category: The PR should be excluded from the changelog and release notes C-feature Category: New features I-usability Zebra is hard to understand or use P-High 🔥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant