greenkeeperio / greenkeeper-lockfile

:lock: Your lockfile, up to date, all the time
https://greenkeeper.io
183 stars 73 forks source link

Current instructions for Travis-ci.org setup are either wrong or incomplete #102

Closed revelt closed 6 years ago

revelt commented 6 years ago

hi all,

I try to enable greenkeeper-lockfile on Travis-ci.org, on an open source package, string-remove-duplicate-heads-tails.

I tried the provided snippet for Travis,

before_install:
# package-lock.json was introduced in npm@5
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
- npm install -g greenkeeper-lockfile@1
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload

screen shot 2018-01-20 at 11 25 39

it does not work. Each commit I publish consists of two commits actually, "master" and another that is incurred by npm version .... I thought, maybe isolating "master"-only would help. Apparently, not. See the last line "except" I nicked from this package's .travis.yml:

language: node_js
node_js:
  - node
before_install:
# package-lock.json was introduced in npm@5
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
- npm install -g greenkeeper-lockfile@1
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
after_success: npm run coverage
notifications:
  email:
    on_success: never
    on_failure: change
branches:
  except:
  - /^v\d+\.\d+\.\d+$/

I tried specifying latest Node and targeting different Node versions, no luck.

I thought maybe I need to provide GH_TOKEN explicitly for this package. I generated the token, ran the Travis CLI travis encrypt GH_TOKEN=<token> --add, it added bunch of encrypted characters onto my .travis.yml, but that didn't work either. Looks like it didn't recognise Node project and ran rake. Apparently, language: node_js row is obligatory...

I tried other variations of .travis.yml and none worked, often causing whole Travis build to fail.


The documentation of this package is either incomplete or dare I say, also erroneous. Besides Travis snippets in this documentation that don't work out-of-the-box, I want to make some observations:

"First create a GitHub access token with push access to your repository and make it available to your CI's environment as GH_TOKEN."

  1. does this apply to open source libraries ran from travis-ci.org?
  2. do I have to generate a token for each library separately and add onto each libraries' .travis.yml?

"Have a look at our Travis CI reference implementation."

Your implementation is not standard since it is not using your supplied snippets. Technically speaking, you're cheating - your .travis.yml links to JS files with a fancy custom setup. What we need is a link to a normal open source library which uses travis-ci.org and which used your setup instructions verbatim and where Greenkeeper updated its lockfiles.

Dear maintainers, I challenge you to find at least one open source library uses your supplied Travis snippets and link to it.


Personally, I find this tool impossible to set up. It took me all Saturday morning and within 8 attempts/tweaks/releases I could not get string-remove-duplicate-heads-tails Greenkeeper to update lockfiles. Greenkeeper itself, on other hand, activated automatically.

Dear maintainers, do you see my frustration here?

On the positive side, thank you for all this anyway; some tooling is better than no tooling and hopefully we can automate lockfile updates eventually. That would save lots of time maintaining OS libraries. 👍

Realtin commented 6 years ago

Hey,

Here is what the settings page for Travis CI looks like:

TravisCI Settings Page of greenkeeperio/greenkeeper-lockfile

looking at this branch build: https://travis-ci.org/codsen/string-remove-duplicate-heads-tails/builds/331317448 it seems you were successful in setting it up.

I'll look into adding some example travis.yaml files and explainations in the readme.

revelt commented 6 years ago

Thanks!