Skip to content

Fixing Build status for step bundles #1088

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

lpusok
Copy link
Contributor

@lpusok lpusok commented May 12, 2025

Checklist

Version

Requires a PATCH version update

Context

BITRISE_BUILD_STATUS env was not set to failing inside a Step bundle.

workflows:
  debug:
    steps:
    - bundle::failing_step_bundle: { }

step_bundles:
  failing_step_bundle:
    title: Failing step
    steps:
    - script@1:
        title: Failing step
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -ex
            exit 1
    - script@1:
        title: Build status NOT failing
        is_always_run: true
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -ex
            # Ouptuts "0", incorrectly
            echo "$BITRISE_BUILD_STATUS"

Changes

Investigation details

Decisions

cli/run_util.go Outdated

// ------------------------------------------
// Main - Preparing & running the steps
for idx, stepPlan := range plan.Steps {
log.Printf("Step %d: %s)", idx, stepPlan.StepID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this log in long term?

@lpusok lpusok force-pushed the SSW-2304-build-status branch from 4a91ca3 to 9519106 Compare May 14, 2025 08:31
@lpusok lpusok changed the title Try to fix Build status for step bundles Fixing Build status for step bundles May 14, 2025
@lpusok lpusok requested a review from godrei May 14, 2025 09:19
@@ -166,10 +166,16 @@ func (r WorkflowRunner) activateAndRunSteps(
failedStepRunResult := currentBuildRunResult.FailedSteps[0]
failedStepEnvs := bitrise.FailedStepEnvs(failedStepRunResult)
*environments = append(*environments, failedStepEnvs...)
if currentStepBundleUUID != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also add a test case for verifying the failed step env vars within a step bundle?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants