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

tweak(server): ignore resources that have a name starting with '.' in resource scan #3001

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jellyton255
Copy link

@jellyton255 jellyton255 commented Dec 14, 2024

Goal of this PR

Like the .git folder, we ignore the .github folder from the resource scan so git repos with a .github folder do not result in a warning during a resource scan.

How is this PR achieving the goal

Adding an additional check to the resource scan loop so that resources with the name ".github" are skipped.

This PR applies to the following area(s)

Server

Successfully tested on

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

@github-actions github-actions bot added the triage Needs a preliminary assessment to determine the urgency and required action label Dec 14, 2024
@Mathu-lmn
Copy link
Contributor

Why not ignoring all folders starting with a dot ?

@jellyton255
Copy link
Author

Why not ignoring all folders starting with a dot ?

Since resource scan is a critical component, I wouldn't want to change something there unless there was a specific desire to do so, like there is with .github. It may be the case that it's a good idea to ignore all folders with a . in the front, but I personally wouldn't be comfortable with making that change w/o an express desire from Cfx.

@DRAIKDev
Copy link

Also will be great to add .vscode : )

@keeganwut
Copy link

Wouldn't it be better (if possible) to leave this up to a server convar? Being able to define different types of files or folders to ignore? I'm sure this could cause issues but if used correctly potentially not.

@DRAIKDev
Copy link

I think the first server resource checks is done before server convars is settled, also seems a bit unnecessary for the vast majority of servers.

@eoshorizon
Copy link

Wouldnt it be much better to add a file like .gitignore where we can define content that should be skipped? if it doesnt exist then use the current defaults?

@AvarianKnight
Copy link
Contributor

It would probably just be better to ignore any file starting with a ., windows already treats these as a hidden file there's no reason we shouldn't do the same imo.

@Maximus7474
Copy link

Definetly the best approach to just ignore all the folders starting with .
There are so many that can be used for various reasons, can also be useful without it being linked ignoring non resource folders

@AvarianKnight
Copy link
Contributor

This should probably be specifically done for directories, not every file.

@jellyton255
Copy link
Author

True, lemme fix that real quick.

@jellyton255
Copy link
Author

@tabarra If/when this gets merged, you'll eventually want to update https://github.com/tabarra/txAdmin/blob/8cbc767aa24e614fe2dc801810cb3ea58df282fd/core/extras/serverDataScanner.ts to mirror this change.

@thelindat
Copy link
Contributor

You've messed up your PR and are reverting changes to the FiveM repo since your initial commit was made.

@jellyton255 jellyton255 reopened this Feb 10, 2025
@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Feb 10, 2025
@FabianTerhorst
Copy link
Contributor

This should probably be specifically done for directories, not every file.

More specifically it should ignore all childs inside a directory starting with "." and any files starting with ".".

@jellyton255 jellyton255 changed the title tweak(server): ignore .github folder in resource scan tweak(server): ignore resources that have a name starting with '.' in resource scan Feb 10, 2025
@tabarra
Copy link
Contributor

tabarra commented Feb 11, 2025

@jellyton255 Thanks for the heads up, but my scanner implementation will be deprecated soon, as I'll switch to the new ScanResourceRoot native:
https://docs.fivem.net/natives/?_0x636F097F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants