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

Bundle from a manifest #69

Merged
merged 3 commits into from
Feb 27, 2023
Merged

Bundle from a manifest #69

merged 3 commits into from
Feb 27, 2023

Conversation

egreer
Copy link
Contributor

@egreer egreer commented Feb 25, 2023

This removes the git ls-files -z dependancy in file listing for inclusion in the gem. This should remove the issues in the deployment action

fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace

I chose to go with an explicit manifest set of patterns as it seemed the easiest to control. I tired reading the .gitignore file with something like:

  (Dir['**/**/*'] - Dir.glob(File.read('.gitignore').split("\n"))).reject do |f|
    f.match(%r{^(test|spec|features|coverage|docker|bin|.github)/})
  end

But Dir.glob doesn't process the same patterns as .gitignore so it included a bunch of extra files. (There were also a bunch of extra files with git ls-files -z like the docker files and bin files that were are including unnecessarily)

The best library to match the git results seemed to be https://github.com/robotdana/fast_ignore but getting it to install in bundler ahead of the other gems seemed more complicates.

-This also splits the bundle caches (doesn't resolve local issues but just in case the two versions are interfering with each other)

@egreer egreer requested review from wkirby and HenryKeiter February 25, 2023 16:56
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.files = Dir.glob(File.read('Manifest.txt').split)
Copy link
Contributor

Choose a reason for hiding this comment

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

 s.files         = Dir["{app,config,lib}/**/*", "CHANGELOG.md", "MIT-LICENSE", "README.md"]

Base automatically changed from feature/rubocop-fixes to main February 27, 2023 17:30
@egreer egreer merged commit 1d537c1 into main Feb 27, 2023
@egreer egreer deleted the feature/bundle-manifest branch February 27, 2023 17:31
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.

2 participants