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

Introduce .build_ignore file #2089

Merged
merged 1 commit into from Jun 23, 2023
Merged

Conversation

manuraj17
Copy link
Contributor

Relates to #1150

The requirement was to reduce the number of files that were added to the release build.

Introducing a new simple text file .build_ignore which containst the list of files to be rejected. In the gemspec file we update the reject method definition to reject files listed in this file. It involes nested loops at the moment so not the best of efficiency, although we are dealing with very less amount of data hence should not take up too much time. We can always look into optimisations. We can treat this as a starting point.

Changes are only currently added to newrelic_rpm.gemspec to get feedback.

This is one of my first contribution here, so aplogies in advance if I have broken any contribution guidelines uknowingly. Please call it out so that I can correct them.

@CLAassistant
Copy link

CLAassistant commented Jun 20, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the community To tag external issues and PRs submitted by the community label Jun 20, 2023
@tannalynn
Copy link
Contributor

Thanks for contributing! It looks like bundler ran into an issue parsing this change. This is the output:

>Run bundle

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `newrelic_rpm.gemspec`: undefined local variable or method `rf' for main:Object. Bundler cannot continue.

 #  from /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/newrelic_rpm.gemspec:[4](https://github.com/newrelic/newrelic-ruby-agent/actions/runs/5319812254/jobs/9643514662?pr=2089#step:5:5)2
 #  -------------------------------------------
 #    reject_list = File.read("./.build_ignore").split("\n")
 >    file_list = `git ls-files -z`.split("\x0").reject { |f| reject_list.any? |rf| f.start_with?(rf)  }
 #    build_file_path = 'lib/new_relic/build.rb'
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /home/runner/work/newrelic-ruby-agent/newrelic-ruby-agent/Gemfile:[6](https://github.com/newrelic/newrelic-ruby-agent/actions/runs/5319812254/jobs/9643514662?pr=2089#step:5:7)
 #  -------------------------------------------
 #  source 'https://rubygems.org/'
 >  gemspec name: 'newrelic_rpm'
 #  -------------------------------------------

Once this is addressed, I'll take a look again and make sure everything is good!

@manuraj17
Copy link
Contributor Author

@tannalynn My bad! I missed out a bracket, since there were no tests for this I just added the snippet and pushed for feedback. I have made changes and tried building the gem as well.

Files to be ignored during build are added in a simple text file,
newline seperated. We then iterate and reject.
@manuraj17
Copy link
Contributor Author

@tannalynn I had force pushed the changes to keep the commit history clean of minor changes - I forgot to confirm if that was a habit followed here. You might want to delete and pull this branch again to avoid conflicts. Sorry about that, will restrict to normal push.

Copy link
Contributor

@tannalynn tannalynn left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! The tests failing are unrelated to this PR and are already fixed on dev, so I'm going to go ahead and merge this. We appreciate the contribution!

@tannalynn tannalynn merged commit 91e14c4 into newrelic:dev Jun 23, 2023
23 of 25 checks passed
kaylareopelle added a commit that referenced this pull request Jul 5, 2023
The test/agent_helper.rb file was overlooked in our switch to the new
file inclusion process introduced in PR#2089
#2089

This file is required for the public API
NewRelic::Agent.require_test_helper.

Furthermore, build.rb was still included. This file used to be
generated with Jenkins during our release process and has not been
created with a release since version 6.13.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs submitted by the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants