question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lint broken with latest version on our CI

See original GitHub issue

Expected Behavior

Lint running well

Current Behavior

Lint breaks

Failure Information (for bugs)

After upgrading to v8.7.0 from v8.6.0 lint breaks with the following error message on our CI:

Error: Command failed: git merge-base master HEAD
fatal: Not a valid object name master

command:

$ npm run lint
> nx workspace-lint && nx affected:lint --parallel --all --maxParallel 4

Runs well locally. Runs well on CI with v8.6.0.

Steps to Reproduce

nx affected:lint --parallel --all --maxParallel 4

Context

  • nx v8.7.0
  • gitlab CI
  • works well with nx v8.6.0

Failure Logs

Error: Command failed: git merge-base master HEAD
fatal: Not a valid object name master

    at checkExecSyncError (child_process.js:629:11)
    at Object.execSync (child_process.js:666:13)
    at getFilesUsingBaseAndHead (/builds/[repo]/node_modules/@nrwl/workspace/src/command-line/shared.js:108:39)
    at Object.parseFiles (/builds/[repo]/node_modules/@nrwl/workspace/src/command-line/shared.js:93:20)
    at Object.affected (/builds/[repo]/node_modules/@nrwl/workspace/src/command-line/affected.js:16:35)
    at Object.exports.commandsObject.yargs.usage.command.command.command.command.command.command.command.command.command.command.command.args [as handler] (/builds/[repo]/node_modules/@nrwl/workspace/src/command-line/nx-commands.js:66:138)
    at Object.runCommand (/builds/[repo]/node_modules/@nrwl/workspace/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/builds/[repo]/node_modules/@nrwl/workspace/node_modules/yargs/yargs.js:1022:30)
    at Object.get [as argv] (/builds/[repo]/node_modules/@nrwl/workspace/node_modules/yargs/yargs.js:965:21)
    at Object.<anonymous> (/builds/[repo]/node_modules/@nrwl/cli/bin/nx.js:38:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [repo]@1.0.0 lint: `nx workspace-lint && nx affected:lint --parallel --all --maxParallel 4`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [repo]@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bboehm86commented, Feb 3, 2020

When using Merge Requests on GitLab CI git merge-base master HEAD won’t work on the runners. You’ll need to run git fetch origin before anything else.

0reactions
kkuriatacommented, Apr 21, 2020

I can confirm that git fetch origin helps on Gitlab CI.

.gitlab-ci.yml:

image: node:lts

before_script:
  - yarn install
  - git fetch origin

stages:
  - lint

Linters:
  stage: lint
  script:
    - yarn lint

package.json:

"scripts": {
   "lint": "nx affected --target=lint --base=remotes/origin/master --parallel"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexplained CI Lint Failures (#207320) · Issues - GitLab
A customer has several projects with CI/CID pipelines that use the "needs" keyword. Inexplicably yaml invalid and error messages appear for ...
Read more >
Install | golangci-lint
Versioning Policy · A patch version update in a specific linter that results in golangci-lint reporting fewer errors. · A bug fix to...
Read more >
Performance Tuning - Google Samples
Try using the latest versions of lint (the Android Gradle plugin), as well as of Gradle — even if that means using a...
Read more >
How to Use GitHub Super Linter in Your Projects
We will name this job "Lint Code Base" and ask GitHub to run our job on a runner with the last version of...
Read more >
README - semantic-release
semantic-release is meant to be executed on the CI environment after every ... Obtain the commit corresponding to the last release by analyzing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found