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

⚠️ Archetypes and Custom Assessments #476

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

mansam
Copy link
Collaborator

@mansam mansam commented Aug 17, 2023

No description provided.

ApplyTags []CategorizedTag `json:"applyTags,omitempty" yaml:"applyTags,omitempty"`
AutoAnswerFor []CategorizedTag `json:"autoAnswerFor,omitempty" yaml:"autoAnswerFor,omitempty"`
Selected bool `json:"selected,omitempty" yaml:"selected,omitempty"`
}
Copy link
Member

Choose a reason for hiding this comment

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

@mansam Is there going to be an answers array on the question struct?

Questionnaire Ref `json:"questionnaire" yaml:"questionnaire"`
Sections []Section `json:"sections" yaml:"sections"`
Thresholds Thresholds `json:"thresholds" yaml:"thresholds"`
RiskMessages RiskMessages `json:"riskMessages" yaml:"riskMessages"`
Copy link
Member

Choose a reason for hiding this comment

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

Wondering how we might determine assessment status?

Revision uint
Sections JSON
Thresholds JSON
RiskMessages JSON
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add the Stakeholder & StakeholderGroup at the assessment level here since we can associate them to assessments within the wizard?

@mansam mansam marked this pull request as ready for review September 19, 2023 17:50
@mansam mansam changed the title [WIP] Custom Assessments ⚠️ Custom Assessments Sep 19, 2023
@mansam mansam changed the title ⚠️ Custom Assessments ⚠️ Archetypes and Custom Assessments Sep 19, 2023
@@ -856,10 +1054,13 @@ type Application struct {
Comments string `json:"comments"`
Identities []Ref `json:"identities"`
Tags []TagRef `json:"tags"`
BusinessService *Ref `json:"businessService"`
BusinessService *Ref `json:"businessService" yaml:"businessService"`
Copy link
Contributor

Choose a reason for hiding this comment

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

why is the yaml tag needed. IIRC, it would default to the same camel cased.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what lead to that happening. Fixing.

// Binding is strict: unknown fields in the input will cause binding to fail.
func (h *BaseHandler) BindJSON(ctx *gin.Context, r interface{}) (err error) {
if ctx.Request == nil || ctx.Request.Body == nil {
err = errors.New("invalid request")
Copy link
Contributor

Choose a reason for hiding this comment

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

missing return?

// Binding is strict: unknown fields in the input will cause binding to fail.
func (h *BaseHandler) BindYAML(ctx *gin.Context, r interface{}) (err error) {
if ctx.Request == nil || ctx.Request.Body == nil {
err = errors.New("invalid request")
Copy link
Contributor

Choose a reason for hiding this comment

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

missing return here?

- key: A
value: 1
- key: B
value: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Why facts removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Application resource doesn't have a facts field, so these were just getting ignored. This PR turns on strict binding, so the unknown field causes a failure.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, makes sense.

@jortel
Copy link
Contributor

jortel commented Sep 19, 2023

Seems there are yaml tags where they are not needed.

Copy link
Contributor

@jortel jortel left a comment

Choose a reason for hiding this comment

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

LGTM

@jortel
Copy link
Contributor

jortel commented Sep 19, 2023

Ensure the new scopes have been added to auth/roles.

Copy link
Member

@aufi aufi left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Sam Lucidi <slucidi@redhat.com>
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.

4 participants