Skip to content

New Project/StarterProject Error Types #614

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

Merged
merged 2 commits into from
Sep 10, 2021

Conversation

kim-tsao
Copy link
Contributor

@kim-tsao kim-tsao commented Sep 9, 2021

What does this PR do?:

Adds new error types for project and starter project validations

Which issue(s) this PR fixes:

#598

PR acceptance criteria:

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed
  • [ x] Unit/Functional tests

Local tests for now, as updates are being made in the library package. Verified the new types are being returned instead of strings:

image

N/A

  • Documentation

N/A

  • Client Impact

N/A

How to test changes / Special notes to the reviewer:

@@ -111,6 +111,52 @@ func (e *InvalidComponentError) Error() string {
return fmt.Sprintf("the component %q is invalid - %s", e.componentName, e.reason)
}

//MissingProjectRemoteError returns an error if the git remotes object under a project is empty
type MissingProjectRemoteError struct {
Copy link
Member

Choose a reason for hiding this comment

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

This file continue to grow more and more. Maybe it worths having a separate file for each type of error: commands, projects...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll keep this under consideration the next time the file is changed. We will wind up with several files including a common one for an internal function under the same validation package but if we have that many error files, it might make more sense to refactor these into an error package and export that function.

@openshift-ci
Copy link

openshift-ci bot commented Sep 10, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amisevsk, JPinkney, kim-tsao, sleshchenko, yangcao77

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kim-tsao kim-tsao merged commit da620cd into devfile:main Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants