[Stage-QA] Gemfile-Check - WIP

Nikolai Lifanov lifanov at FreeBSD.org
Fri Aug 4 14:15:14 UTC 2017


On 8/4/17 10:04 AM, Torsten Zuehlsdorff wrote:
> 
> 
> On 04.08.2017 15:48, Nikolai Lifanov wrote:
>> On 8/4/17 8:51 AM, Torsten Zuehlsdorff wrote:
>>> Aloha,
>>>
>>> inspired by lifanov and his work in PR 220605 to add a check for
>>> .gemspec of rubygems i tried myself with Gemfile.
>>>
>>> Background is, that checking the actual Gemfile of non rubygem-* ports
>>> is often very time-consuming. When building Gitlab, Redmine or others,
>>> everything is fine. But when executing they fail - because the Gemfile
>>> is not satisfied.
>>>
>>> Its WIP and my first try for an stage-qa script, so every comment is
>>> appreciated. It adds a stage-qa stage for every non rubygem- port. When
>>> executed i (intent) to scan for Gemfiles and checking every file with
>>> bundle check. If bundle fails, the stage-qa fails.
>>>
>>> It worked for simple test. If no Gemfile was present the test was
>>> skipped. If it is, bundle is executed. When removing a needed dependency
>>> it is found. Its also found when the dependency is indirect (not in
>>> Gemfile itself, but a dependency of an dependency listed there).
>>>
>>> But it don't work for net-im/mikutter for example and i don't know why.
>>>
>>> So any feedback would be fine! :)
>>>
>>> Greetings,
>>> Torsten
>>>
>>
>> Hi!
>>
>> I think for something like this, a better initial approach is to make
>> this stage-qa target non-fatal, so warnings instead of errors.
>>
>> At least initially it will cause less disruption and give porters an
>> opportunity to fix the errors.
> 
> Or we fix all issues before submitting - because the ports are broken if
> this fails. The could not be used in any way.
> 
>> I have two thoughts on it so far:
>>
>> $(find ${STAGEDIR} -name Gemfile) is pretty heavy to do on every port.
>> Can we export something to QA_ENV from USE_RUBY and check for this
>> instead?
> 

Add something to QA_ENV from bsd.ruby.mk and check for it in qa.sh.
For example, in bsd.ruby.mk, you can do this:

QA_ENV+= USE_RUBY

and in qa.sh, you can do this:

if [ -n "${USE_RUBY}" ]; then
.... do stuff....

I'm not sure that USE_RUBY is the best variable here, but you can pick
anything defined there.

> I would like to make it optional, but i have no idea how
> 
>> Is "bundle" guaranteed to be installed for ports that ship a Gemfile?
> 
> No.
> 

You can bail if it's not installed.
command -v bundler >/dev/null || ... do something here to exit ...

Or you can pick something else.

>> Otherwise, it looks good and only has minor nits. Can we move this to
>> Phabricator? This will make it easier to review and iterate on.
> 
> I was in doubt it is already good enough for a review. But here we go:
> https://reviews.freebsd.org/D11865
> 
> Greetings and thanks,
> Torsten


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 862 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ruby/attachments/20170804/8dad5065/attachment.sig>


More information about the freebsd-ruby mailing list