Skip to content

feat: Resolve notice severity level from @GtfsValidationNotice annotation.#1475

Merged
davidgamez merged 2 commits intomasterfrom
issue/1472/severity_level
Jun 6, 2023
Merged

feat: Resolve notice severity level from @GtfsValidationNotice annotation.#1475
davidgamez merged 2 commits intomasterfrom
issue/1472/severity_level

Conversation

@bdferris-v2
Copy link
Copy Markdown
Collaborator

@bdferris-v2 bdferris-v2 commented Jun 5, 2023

As originally discussed in https://bit.ly/gtfs-validator-notice-documentation, when we introduced @GtfsValidationNotice to document validation notice, the plan was to follow-up by refactoring SeverityLevel from the notice constructor. This PR performs that refactor.

Specifically, it pulls severityLevel out of Notice and moves it to a new ResolvedNotice class, which is a wrapper around Notice object that includes the resolved severity level. Additionally, the severity level of the notice is resolved when it is added to NoticeContainer, which has been refactored to hold ResolvedNotices now. This paves the way for config-driven severity levels for notices, which could be implemented within NoticeContainer in the future.

Closes #1472.

Please make sure these boxes are checked before submitting your pull request - thanks!

@bdferris-v2 bdferris-v2 requested a review from davidgamez June 5, 2023 06:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 5, 2023

✅ Rule acceptance tests passed.
New Errors: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1430 sources (~0 %) are corrupted.
Commit: b3c8475
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

/** Adds a new validation notice to the container (if there is capacity). */
public void addValidationNotice(ValidationNotice notice) {
if (notice.isError()) {
// TODO: This would be the spot to add customization of notice severity levels in the future.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🥳

@davidgamez davidgamez merged commit 96bb17a into master Jun 6, 2023
@davidgamez davidgamez deleted the issue/1472/severity_level branch June 6, 2023 19:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 6, 2023

✅ Rule acceptance tests passed.
New Errors: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1430 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1430 sources (~0 %) are corrupted.
Commit: dd64e03
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

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.

Refactor ValidationNotice to use @GtfsValidationNotice(severity) instead of passing SeverityLevel in the constructor

2 participants