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

Notice invalid_input_files_in_subfolder not triggered if zip file and subfolder have the same name #1912

Closed
praneethd7 opened this issue Oct 28, 2024 · 7 comments · Fixed by #1972
Assignees
Labels
bug Something isn't working (crash, a rule has a problem) good first issue Good task for newcomers to work on. status: Needs triage Applied to all new issues

Comments

@praneethd7
Copy link
Contributor

Describe the bug

As the title says. Currently, the notice invalid_input_files_in_subfolder is not triggered when the zip file (without .zip) and the sub folder have the same name.

Possible Reason:
The condition is not satisfied here and the notice is not raised

if (containsSubfolder && entryName.contains(subfolder) && entryName.endsWith(".txt")) {

Steps/Code to Reproduce

Example Case [has subfolder piercetransit-wa-us--flex-v2]:
piercetransit-wa-us_zip.zip - Will raise the notice
piercetransit-wa-us--flex-v2.zip - Does not raise the notice

Expected Results

Image

Actual Results

Image

Screenshots

No response

Files used

No response

Validator version

6.0.0

Operating system

Windows

Java version

No response

Additional notes

No response

@praneethd7 praneethd7 added bug Something isn't working (crash, a rule has a problem) status: Needs triage Applied to all new issues labels Oct 28, 2024
@github-project-automation github-project-automation bot moved this to Requires investigation in Bug triage Oct 28, 2024
@emmambd emmambd added this to the 7.0 Validator Release milestone Oct 28, 2024
@qcdyx qcdyx removed this from the 7.0 Validator Release milestone Dec 9, 2024
@emmambd emmambd added the good first issue Good task for newcomers to work on. label Feb 5, 2025
sylvansson added a commit to sylvansson/gtfs-validator that referenced this issue Feb 6, 2025
@sylvansson
Copy link
Contributor

Hi @praneethd7, I looked into this and I think the filename was a red herring. I shared some findings in #1972. Were both of your ZIP files created the same way?

@praneethd7
Copy link
Contributor Author

praneethd7 commented Feb 6, 2025

@sylvansson Thank you for taking a crack at this. Looked through the PR and it LGTM. Could you elaborate on what you mean by " Were both of your ZIP files created the same way?"

@qcdyx qcdyx self-assigned this Feb 6, 2025
@sylvansson
Copy link
Contributor

I'm just curious as to whether they were created using the same command or tool. Apparently the ZIP file specification doesn't explicitly require or disallow entries for folders, there's a great explanation here.

@sylvansson
Copy link
Contributor

@qcdyx I see you just picked this up. I just want to make sure you know I already have a PR (#1972) for this :-)

@qcdyx
Copy link
Contributor

qcdyx commented Feb 7, 2025

@sylvansson Got it!

qcdyx pushed a commit that referenced this issue Feb 12, 2025
* #1912 Fix logic to check for nested GTFS files in ZIP
@github-project-automation github-project-automation bot moved this from Requires investigation to Done in Bug triage Feb 12, 2025
@praneethd7
Copy link
Contributor Author

@sylvansson, I have not used any command to create these zip files. I used the Compress to feature on my Windows machine. I hope that answers your question.

@sylvansson
Copy link
Contributor

It's interesting that they would be structured differently then. Good to know, thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (crash, a rule has a problem) good first issue Good task for newcomers to work on. status: Needs triage Applied to all new issues
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants