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

Recognize invalid input as a buildplanner error response. #3622

Open
wants to merge 2 commits into
base: version/0-48-0-RC1
Choose a base branch
from

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Dec 23, 2024

BugDX-3178 INIT: Wrong messages for invalid formatting

Sample:

% state init --language=python username/test_1
Initializing Project

█ Something Went Wrong

 x Command failed due to unexpected error. For your convenience, this is the error chain:
  Could not create project: Project name can only contain alphanumeric, '.' or '-' characters.

@mitchell-as
Copy link
Contributor Author

The scan failure will be resolved if we decide to backport some CVE fixes from v48 into this v47 branch.

@mitchell-as mitchell-as requested a review from Naatan December 23, 2024 19:46
@mitchell-as mitchell-as marked this pull request as ready for review December 23, 2024 19:46
@mitchell-as
Copy link
Contributor Author

The Target & Verify failure is due to something I don't understand:

Fetching meta for PR 3622..
  |- Fetching Active PR 3622..
    |- PR retrieved: Recognize invalid input as a buildplanner error response.
  |- Done
     
  |- Extracting Jira Issue ID from Active PR: Recognize invalid input as a buildplanner error response...
    |- Extracted Jira Issue ID: DX-3178
  |- Done
     
  |- Fetching Jira issue..
  |- Done
     
  |- Fetching Jira Versions..
  |- Done
     
  |- Extracting target fixVersion from Jira issue..
    |- Extracted fixVersion: 0.47.0-RC2
  |- Done
     
  |- Fetching Version PR by name: 'Version 0.47.0-RC2'..
    |- No version PR found
  |- Done
     
Done
   
Creating version PR for fixVersion 0.47.0-RC2..
  |- Detecting base ref to fork from..
    |- Checking if master is safe to fork from for version 0.47.0-RC2..
      |- Master is unsafe as it has versions greater than 0.47.0-RC2
    |- Done
       
    |- Finding nearest matching version PR to fork from..
      |- Nearest matching PR: Version 0.47.0-RC1 (3464), branch: version/0-47-0-RC1, SHA: 60540815fe6242a33293c4e3cdd521dcee875326
    |- Done
       
  |- Done
     
  |- Creating version branch, name: version/0-47-0-RC2, forked from: 60540815fe6242a33293c4e3cdd521dcee875326..
    |- Error: failed to create version PR:
           failed to create branch:
               failed to create ref: 'POST https://api.github.com/repos/ActiveState/cli/git/refs: 422 Reference update failed []'

There seems to be something wrong with the v47 RC2 branch maybe?

@Naatan
Copy link
Member

Naatan commented Jan 2, 2025

@mitchell-as it was failing because the RC2 branch didn't exist, and it failed to create it for whatever reason.

But I don't think we'll do an RC2, I've repurposed this for v48. Please update your PR accordingly.

Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

I don't think this addresses the expected behaviour in the bug report, unless this is implying a mechanic I'm remembering?

@mitchell-as mitchell-as changed the base branch from version/0-47-0-RC2 to version/0-48-0-RC1 January 2, 2025 22:15
@mitchell-as
Copy link
Contributor Author

@Naatan without this fix, you get the "Command failed due to unexpected error", which is thoroughly unhelpful and reported to rollbar. With this fix, you'll get an input error that tells you your project has unexpected characters in it.

@mitchell-as mitchell-as requested a review from Naatan January 2, 2025 22:17
@Naatan
Copy link
Member

Naatan commented Jan 2, 2025

@Naatan without this fix, you get the "Command failed due to unexpected error", which is thoroughly unhelpful and reported to rollbar. With this fix, you'll get an input error that tells you your project has unexpected characters in it.

That's a good change, I'm all for it. But the bug is raising a different issue altogether from what I can tell. Can you ensure that this fix produces the expected result given in the bug, or otherwise address why it's inappropriate to address the expected result?

Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

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

@mitchell-as
Copy link
Contributor Author

I misremembered. You'll still get "unexpected error", but you'll be notified that you supplied an invalid name. The buildplanner provides this error message. I've updated the PR description with an example to hopefully make this more clear.

I hope we're not talking past each other. Sorry if I'm missing something.

@mitchell-as mitchell-as requested a review from Naatan January 2, 2025 22:52
@mitchell-as
Copy link
Contributor Author

It occurs to me that maybe we want to recognize this as an input error though. We may need to add additional plumbing to recognize certain types of buildplanner errors as input errors. Should I do that here? Or should we do this in a new ticket? Or not at all?

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