Skip to content

Add Better a Error Message For Undefined Reference Types#11159

Merged
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
Mab879:betters_error_for_invalid_refs
Oct 6, 2023
Merged

Add Better a Error Message For Undefined Reference Types#11159
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
Mab879:betters_error_for_invalid_refs

Conversation

@Mab879
Copy link
Copy Markdown
Member

@Mab879 Mab879 commented Sep 29, 2023

Description:

This PR improves the handling of undefined reference types by adding a better error message. This also fixes exception in the message text since self was not defined.

Rationale:

  • Better error messages
  • Fixes self is not defined

Review Hints:

  1. Add invalid reference type (e.g. cci) to your favorite rule
  2. Build the project
  3. Observe the error message improvement

This commit ensure that user is given a better error message if they
add a reference type that the project doesn't know about.
@Mab879 Mab879 added the Infrastructure Our content build system label Sep 29, 2023
@Mab879 Mab879 added this to the 0.1.70 milestone Sep 29, 2023
@github-actions
Copy link
Copy Markdown

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 9b74309 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 56.9%.

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Oct 2, 2023
Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

I like the change very much. I have reproduced the error. But I think we should do the same change also for "identifiers".

@Mab879 Mab879 modified the milestones: 0.1.70, 0.1.71 Oct 2, 2023
@Mab879
Copy link
Copy Markdown
Member Author

Mab879 commented Oct 5, 2023

After a quick test it seems that we don't validate what identifiers like we do references. I feel that adding this behavior should be done on another PR.

Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

OK, let's fix it in another PR, I have reported the issue to the upstream in #11183 so that we won't forget.

@jan-cerny jan-cerny merged commit c16d1d0 into ComplianceAsCode:master Oct 6, 2023
@Mab879 Mab879 deleted the betters_error_for_invalid_refs branch October 6, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Our content build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants