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

Initial usage of buildplanner for state init. #2844

Merged
merged 5 commits into from
Oct 25, 2023

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Oct 24, 2023

StoryDX-2271 `state init` uses buildplanner and not the mono api for creating commits

@mitchell-as mitchell-as requested a review from MDrakos October 24, 2023 15:28
@mitchell-as mitchell-as marked this pull request as ready for review October 24, 2023 15:28
@mitchell-as
Copy link
Contributor Author

I'm not really sure what I'm doing here, so feel free to correct me or suggest what I can do better.

Copy link
Member

@MDrakos MDrakos left a comment

Choose a reason for hiding this comment

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

Honestly, this looks really good so far. The error handling will need to be updated to work with this new mutation. It's not obvious how to do that and the implicit nature of graphQL + Go unmarshalling doesn't make it easier. I've left some examples that hopefully help get you started. Let me know if I can help clear anything up.

pkg/platform/model/buildplanner.go Outdated Show resolved Hide resolved
pkg/platform/model/buildplanner.go Show resolved Hide resolved
@mitchell-as
Copy link
Contributor Author

mitchell-as commented Oct 24, 2023

I started implementing user-facing errors for buildplanner errors raised during project creation because I think we're supposed to move away from locale.WrapError() and locale.WrapInputError(). I created a ticket for finishing user-facing errors for the rest of the initialize runner's package here: https://activestatef.atlassian.net/browse/DX-2300. I think it's out of scope for this ticket.

@mitchell-as mitchell-as requested a review from MDrakos October 24, 2023 20:53
Copy link
Member

@MDrakos MDrakos left a comment

Choose a reason for hiding this comment

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

Almost there! My comments are primarily based on the knowledge that I picked up from working on the Build Planner code previously, so I wouldn't expect you to have known about them.

pkg/platform/api/buildplanner/model/buildplan.go Outdated Show resolved Hide resolved
pkg/platform/runtime/buildexpression/buildexpression.go Outdated Show resolved Hide resolved
pkg/platform/runtime/buildexpression/buildexpression.go Outdated Show resolved Hide resolved
Use a params struct instead of arguments list.
Make minimal buildexpression creation function even more minimal.
Use timestamp from Platform rather than from current time.
Forward buildplanner error messages.
@mitchell-as mitchell-as requested a review from MDrakos October 25, 2023 16:03
@mitchell-as
Copy link
Contributor Author

I had to do a bit of cleanup. Let me know if I missed anything.

MDrakos
MDrakos previously approved these changes Oct 25, 2023
Copy link
Member

@MDrakos MDrakos left a comment

Choose a reason for hiding this comment

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

Looks good! Just one nit.

return &ProjectCreatedError{pcErr.Type}
default:
return errs.New(fallbackMessage)
if pcErr.Type != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a comment here and reference the user-facing errors story? We should be handling the specific error types but I know that's out of scope currently.

@mitchell-as mitchell-as merged commit 0d01e1a into version/0-42-0-RC1 Oct 25, 2023
6 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-2271 branch October 25, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants