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

Return a better user visible error when pipeline references an unrecognised team slug #155

Merged
merged 1 commit into from
May 25, 2021

Conversation

yob
Copy link
Contributor

@yob yob commented May 25, 2021

In #117 @keith reported that we return a particularly unhelpful error to users when a pipeline references a team slug that doesn't exist:

resource "buildkite_pipeline" "repo2" {
    name = "repo2"
    repository = "[email protected]:org/repo2"
    steps = file("./steps.yml")

    team {
        slug = "not valid"
        access_level = "READ_ONLY"
    }
}

The error was:

Error: No ID was supplied

I'm not 100% sure this error handling is where the error @keith saw was from, but it seems pretty likely. Even if it's not, this seems like a good change to make.

The Printf() is only visible to users when debug mode is on, which will almost never be true. Moving that message to an error that will be displayed to the user (and can be searched in this codebase while debugging) seems like a win.

@yob yob requested a review from a team May 25, 2021 02:41
eleanorakh
eleanorakh previously approved these changes May 25, 2021
Copy link

@eleanorakh eleanorakh left a comment

Choose a reason for hiding this comment

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

Looks like a sensible change! 👍

…gnised team slug

In #117 @keith reported that we return a particularly unhelpful error to
users when a pipeline references a team slug that doesn't exist:

    resource "buildkite_pipeline" "repo2" {
        name = "repo2"
        repository = "[email protected]:org/repo2"
        steps = file("./steps.yml")

        team {
            slug = "not valid"
            access_level = "READ_ONLY"
        }
    }

The error was:

> Error: No ID was supplied

I'm not 100% sure this error handling is where the error @keith saw was
from, but it seems pretty likely. Even if it's not, this seems like a
good change to make.

The Printf() is only visible to users when debug mode is on, which will
almost never be true. Moving that message to an error that will be
displayed to the user (and can be searched in this codebase while
debugging) seems like a win.
@yob yob force-pushed the better-error-on-unrecognised-team-slug branch from 26327a9 to f11f39b Compare May 25, 2021 10:30
@yob yob merged commit 85305e3 into main May 25, 2021
@yob yob deleted the better-error-on-unrecognised-team-slug branch May 25, 2021 10:39
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