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

feat: Add a few missing "Affected files" references #1427

Merged
merged 5 commits into from
May 15, 2023

Conversation

bdferris-v2
Copy link
Collaborator

Reliably parsing RULES.md is an inexact science and I missed a few "Affected files" references in my first automated pass due to inconsistent formatting in RULES.md. This PR adds them in. Part of #1324.

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

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: ./gradlew goJF.

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

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

@isabelle-dr
Copy link
Contributor

isabelle-dr commented May 3, 2023

One question that is probably out of scope for this PR:
During the contributor meeting, we talked about merging the two concepts of "files affected" and "references" into one category.
In this PR it looks like we are going to keep the two categories via @FileRefs and @UrlRef, correct?

Also, we might want to have @FileRef and @UrlRef or @FileRefs and @UrlRefs for consistency?

@bdferris-v2
Copy link
Collaborator Author

@isabelle-dr a couple points:

  • @FileRefs is used to capture all GTFS file links, whether they were in "files affected" or "references".
  • @UrlRef is used to capture links to arbitrary webpages not already covered by the existing spec. You can see it used in this PR for a link to the "Original Python validator implementation". We don't want someone using it to link to a section of the GTFS spec or a GTFS file reference (we could probably enforce that with a unit-test?)

Does that make sense?

There is a bit of an edge-case where for the "https://gtfs.org/best-practices/#dataset-publishing--general-practices" link. I suppose I could update that to be a section ref?

As for @FileRefs vs @UrlRef, the difference is intentional.

Namely, @FileRefs can contain an array of values, such that you can specify:

files = @FileRefs({GtfsStopTimeSchema.class, GtfsStopSchema.class})

I didn't want to go with @FileRef here because it seemed more verbose to have to do something like:

files = {@FileRef(GtfsStopTimeSchema.class), @FileRef(GtfsStopSchema.class)}

Compare that to @UrlRef, which has two distinct arguments:

@UrlRef(
            label = "Original Python validator implementation",
            url = "https://github.com/google/transitfeed")

It doesn't make as much sense to do @UrlRefs because it's not possible to construct multiple different URLs in the specification. Thus, I did go with individual @UrlRef instead.

Looking back, I think I had imagined adding more fields to @FileRefs but instead, that info ended up in @SectionRefs instead. We could probably refactor the code to look something like:

files = {GtfsStopTimeSchema.class, GtfsStopSchema.class}

getting rid of @FileRefs entirely.

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

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

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM

@bdferris-v2 bdferris-v2 merged commit 1c96c4d into master May 15, 2023
@bdferris-v2 bdferris-v2 deleted the issue/1324/affected_files branch May 15, 2023 16:05
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.

3 participants