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

Add Better Error Display #5298

Merged
merged 8 commits into from
Dec 5, 2023
Merged

Add Better Error Display #5298

merged 8 commits into from
Dec 5, 2023

Conversation

ChrisHinchey
Copy link
Contributor

@ChrisHinchey ChrisHinchey commented Nov 29, 2023

Signed-off-by: Christopher Andrew Hinchey <[email protected]>
Signed-off-by: Christopher Andrew Hinchey <[email protected]>
Signed-off-by: Christopher Andrew Hinchey <[email protected]>
Signed-off-by: Christopher Andrew Hinchey <[email protected]>
@ChrisHinchey ChrisHinchey changed the title Added Better Error Display Add Better Error Display Nov 29, 2023
@ChrisHinchey ChrisHinchey self-assigned this Nov 29, 2023
justification ||
rationale ||
comments ||
errorMessage !== ''
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to the other ones blocks, unless we're explicitly only checking for empty string, we should probably do the 'string as boolean' thing so that it handles null/undefined as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we aren't checking for a value from the control.hdf object and rather a custom string based on a condition, wouldn't we want to still check for an empty string unless we make the fail condition a null/undefined

Copy link
Contributor

@Amndeep7 Amndeep7 Dec 5, 2023

Choose a reason for hiding this comment

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

Re-reading the code, I see what you mean w/r to that function basically returning an enum of [warning | empty-string]. However, in that case, it makes even more sense to just do v-if="stuff || comments || errorMessage" cause "errorMessage !== ''" is semantically equivalent to "errorMessage (as a boolean expression)" due to the empty string being falsy. Consequently, this is mostly just a stylistic choice here for the coding in order to simplify it.

ChrisHinchey and others added 2 commits November 29, 2023 21:29
@aaronlippold
Copy link
Member

This has been very useful over the last few days. Hopefully we can get it merged during this release.

@aaronlippold
Copy link
Member

Related mitre/saf#2074

@aaronlippold
Copy link
Member

Related inspec/inspec#6900

justification ||
rationale ||
comments ||
errorMessage !== ''
Copy link
Contributor

@Amndeep7 Amndeep7 Dec 5, 2023

Choose a reason for hiding this comment

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

Re-reading the code, I see what you mean w/r to that function basically returning an enum of [warning | empty-string]. However, in that case, it makes even more sense to just do v-if="stuff || comments || errorMessage" cause "errorMessage !== ''" is semantically equivalent to "errorMessage (as a boolean expression)" due to the empty string being falsy. Consequently, this is mostly just a stylistic choice here for the coding in order to simplify it.

Copy link
Contributor

@Amndeep7 Amndeep7 left a comment

Choose a reason for hiding this comment

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

I'd appreciate it if you made that stylistic change but it's not the most important thing so I'mma approve this pr. Merge it in after you make your choice. If you choose not to make the change, you're gonna need to re-run the e2e test until it decides to pass before applying the ready-to-merge label.

Signed-off-by: Christopher Andrew Hinchey <[email protected]>
@ChrisHinchey
Copy link
Contributor Author

I don't mind making the stylistic change, I just wasn't sure if we wanted to make it explicit since it is handled differently from the rest. Just pushed the change

@ChrisHinchey ChrisHinchey added the ready-to-merge Used by mergify to identify if a PR is ready to merge into master. label Dec 5, 2023
Copy link

sonarqubecloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mergify mergify bot merged commit f81b4cf into master Dec 5, 2023
18 checks passed
@mergify mergify bot deleted the fix-5226 branch December 5, 2023 08:12
Amndeep7 added a commit that referenced this pull request Dec 29, 2023
* Added backtrace to control row col

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

* Add additional error display

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

* Removed icon

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

* Removed console log

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

* Fixed backtrace always being present

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

* Update apps/frontend/src/components/cards/controltable/ControlRowDetails.vue

Co-authored-by: Amndeep Singh Mann <[email protected]>

* Stylistic change

Signed-off-by: Christopher Andrew Hinchey <[email protected]>

---------

Signed-off-by: Christopher Andrew Hinchey <[email protected]>
Co-authored-by: Amndeep Singh Mann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Used by mergify to identify if a PR is ready to merge into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error and backtrace should be in the test results and control details
3 participants