fabric8-ui / fabric8-planner

https://fabric8-ui.github.io/fabric8-planner/
Apache License 2.0
26 stars 62 forks source link

Master build is broken #2460

Closed jarifibrahim closed 6 years ago

jarifibrahim commented 6 years ago

The recent changes to the Jenkins file broke the master build. Master build fails with

java.lang.NoSuchMethodError: No such DSL method 'ci' found among steps ...

This line needs to be updated https://github.com/fabric8-ui/fabric8-planner/blob/master/Jenkinsfile#L39

debloper commented 6 years ago

Can you please post a link to a broken build where this reflects? My initial assumption would be any of the recent changes introduced this.

release.groovy defines the pipeline.ci() method (which should get project as passed argument). This error would mean that file is not being loaded/parsed - which would trigger a much bigger issue than just this error.

jarifibrahim commented 6 years ago

Look at this build https://jenkins.cd.test.fabric8.io/job/fabric8-ui/job/fabric8-planner/job/master/157/console

The pipeline.ci() method did not need the project param. It was added in this PR https://github.com/fabric8-ui/fabric8-planner/pull/2399/files#diff-318c73c5bdb7e830d5e72aefe23c7df6R2

pranavgore09 commented 6 years ago

still fails with

ERROR: No Change ID found, is this a Pull Request?
Finished: FAILURE

Because this line should not run for the master build. @debloper

pranavgore09 commented 6 years ago

Build works fine but semantic-release is broken https://jenkins.cd.test.fabric8.io/job/fabric8-ui/job/fabric8-planner/job/master/163/consoleFull

+ npm run semantic-release
npm ERR! missing script: semantic-release

Issue: we execute npmRelease from pipeline library which runs npm run semantic-release command and we have removed that target. so it fails.

Solution 1: Update the pipeline-library to execute npm run build -- --release command. But that MAY affect other projects using that library. Risky and non testable.

Solution 2: We support back npm run semantic-release like it was earlier.

Current npm run build -- --release command just builds and actually doesn't release a new version. It is not showing any errors as it runs in a child process. Hence need to change the code like following

  if (argv.release) {
    proc.exec('$(npm bin)/semantic-release', function(error, stdout, stderr) {
      console.log(stdout);
      console.log(error);
      console.log(stderr);
  });

which fails with following errors

➜  fabric8-planner git:(master) ✗ npm run build -- --release

> fabric8-planner@0.0.0-development build /home/ijarif/fabric8-planner
> gulp build "--release"

[16:55:07] Using gulpfile ~/fabric8-planner/gulpfile.js
[16:55:07] Starting 'build'...
[16:55:07] Finished 'build' after 18 ms
[Semantic release]: This run was not triggered in a known CI environment, running in dry-run mode.
[Semantic release]: Load plugin verifyConditions from ./node_modules/@krux/condition-jenkins
[Semantic release]: Load plugin getLastRelease from @semantic-release/npm
[Semantic release]: Load plugin analyzeCommits from @semantic-release/commit-analyzer
[Semantic release]: Load plugin generateNotes from @semantic-release/release-notes-generator
[Semantic release]: Load plugin publish from @semantic-release/npm
[Semantic release]: Load plugin publish from @semantic-release/github
[Semantic release]: Run automated release from branch master
[Semantic release]: Call plugin verify-conditions

{ Error: Command failed: $(npm bin)/semantic-release
[Semantic release]: An error occurred while running semantic-release: TypeError: Cannot read property 'hasOwnProperty' of undefined
    at module.exports (/home/ijarif/fabric8-planner/node_modules/@krux/condition-jenkins/index.js:7:11)
    at Object.verifyConditions (/home/ijarif/fabric8-planner/node_modules/semantic-release/lib/plugins/normalize.js:41:26)
    at module.exports (/home/ijarif/fabric8-planner/node_modules/semantic-release/index.js:43:17)
    at <anonymous>

    at ChildProcess.exithandler (child_process.js:270:12)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '$(npm bin)/semantic-release' }
[Semantic release]: An error occurred while running semantic-release: TypeError: Cannot read property 'hasOwnProperty' of undefined
    at module.exports (/home/ijarif/fabric8-planner/node_modules/@krux/condition-jenkins/index.js:7:11)
    at Object.verifyConditions (/home/ijarif/fabric8-planner/node_modules/semantic-release/lib/plugins/normalize.js:41:26)
    at module.exports (/home/ijarif/fabric8-planner/node_modules/semantic-release/index.js:43:17)
    at <anonymous>
jarifibrahim commented 6 years ago

Reopening since master build is working fine but semantic-release is failing