Closed (outdated)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Flag core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2024 at 21:14 UTC
Updated:
22 Nov 2024 at 16:04 UTC
Jump to comment: Most recent
The Flag module contains a variety of files whose purpose is to support development. Things like linting rules, automated tests, and package management for dev dependencies have no real purpose for an end user downloading a release.
According to the documentation for creating releases, you can exclude these types of files from the final release artifact by including a .gitattributes file.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
kevin.dutra commentedComment #4
ivnishdel
Comment #5
ivnishComment #7
ivnishComment #8
berdirnever seen a project remove test files, are we certain that's a good idea? Core doesn't do that either. Might also affect Gitlab CI?
Comment #9
ivnishGitlab CI is not affected, I checked it.
I haven't seen this before, but the documentation does describe it https://www.drupal.org/node/1068944#s-excluding-non-production-code-from...
Comment #10
berdirI'm specifically talking about the tests folder.
What about a project that extends the flag module and has tests using a trait or base class from Flag? If it's not explicitly depending on the de version, it will get a tagged release through composer without the tests folder.
Comment #11
ivnishYeah, looks like there might be more problems than benefits. Let me revert this commit.
Comment #12
berdirYeah. Also note that Drupal already has a global flag that will not discover or find modules in tests folders which is off by default, in that case the runtime and disk overhead of this is neglectable.
Comment #14
ivnishComment #15
ivnishThanks @Berdir!
Comment #16
kevin.dutra commentedI can understand the use case for leaving the test files in, but can we still remove the other cruft? The main reason I had opened this is that our automated security scans of production infrastructure kept flagging issues among the non-prod files, like packages defined in the Yarn lock file that had open flaws.
Comment #17
ivnish@kevin.dutra I removed some JS garbage here https://git.drupalcode.org/project/flag/-/commit/1aa7bc96950e16b127d126a...
Comment #18
kevin.dutra commentedAh! Okay, I missed that. Thanks @ivnish!