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

ncu-ci: command that shows results of jenkins #161

Merged
merged 5 commits into from
Jun 1, 2018

Conversation

joyeecheung
Copy link
Member

Example:

▶ show-ci pr 12798
{ result: 'FAILURE',
  failures:
   [ { url: 'https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/12151/',
       reason: 'ERROR: Error cloning remote repo \'origin\'' },
     { url: 'https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1604_sharedlibs_fips20_x64/1774/',
       reason: 'not ok 462 parallel/test-fs-error-messages' } ] }

@joyeecheung
Copy link
Member Author

joyeecheung commented Jan 30, 2018

Refs: #158

Some other commands to implement

@joyeecheung joyeecheung changed the title WIP: command that shows results of node-test-pull-request WIP: command that shows results of jenkins Jan 30, 2018
@codecov
Copy link

codecov bot commented Feb 1, 2018

Codecov Report

Merging #161 into master will decrease coverage by 8.74%.
The diff coverage is 61.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #161      +/-   ##
==========================================
- Coverage   88.52%   79.77%   -8.75%     
==========================================
  Files          19       20       +1     
  Lines         723     1078     +355     
==========================================
+ Hits          640      860     +220     
- Misses         83      218     +135
Impacted Files Coverage Δ
lib/cli.js 52.11% <ø> (ø) ⬆️
lib/cache.js 100% <100%> (ø)
lib/pr_data.js 96.15% <100%> (+0.32%) ⬆️
lib/pr_checker.js 98.39% <100%> (-0.01%) ⬇️
lib/file.js 70.83% <20%> (+7.67%) ⬆️
lib/ci.js 59.29% <54.54%> (-33.74%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3dafebf...766fc91. Read the comment docs.

@joyeecheung
Copy link
Member Author

screen shot 2018-02-02 at 6 58 23 pm

A bit more progress...

@joyeecheung joyeecheung force-pushed the show-ci branch 2 times, most recently from 1d14de5 to 18fcbe7 Compare February 28, 2018 00:13
@joyeecheung
Copy link
Member Author

joyeecheung commented Mar 3, 2018

On Windows ERROR: coming from the preparation tasks can be ignored. Should not hide the real errors appeared later on.
https://gist.github.com/joyeecheung/5a1a92cc7d8dc65502bb564ad5cc9e7e

Refs: nodejs/node#19041

@joyeecheung
Copy link
Member Author

Added tests to cache and the jenkins utilities...should be able to land after documentations are added

@joyeecheung joyeecheung force-pushed the show-ci branch 2 times, most recently from 7996277 to 4451d21 Compare April 22, 2018 10:35
joyeecheung added a commit that referenced this pull request Apr 22, 2018
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for #161
- Updates a few CI link patterns
Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

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

Awesome work!

@mmarchini
Copy link
Contributor

@joyeecheung I can help with documentation if you want.

@joyeecheung joyeecheung force-pushed the show-ci branch 6 times, most recently from bfc7e0f to 72782dd Compare May 31, 2018 14:06
@joyeecheung joyeecheung changed the title WIP: command that shows results of jenkins ncu-ci: command that shows results of jenkins May 31, 2018
@joyeecheung
Copy link
Member Author

Docs added, new demo: https://asciinema.org/a/184727

This should be ready to land cc @nodejs/automation

@joyeecheung
Copy link
Member Author

This has been approved by @mmarchini but I still prefer to have some reviews @nodejs/automation before merging. It would be nice to be able to land this before tomorrow's collaboration summit so I can make a release and people can start trying this out - currently I believe the pattern matching of the CI results are not smart enough and we will bump into edge cases from time to time. The more people trying this the better coverage we can have.

Copy link
Contributor

@priyank-p priyank-p left a comment

Choose a reason for hiding this comment

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

I left couple of comments, overall LGTM, Nice work!

I still quite did not get what the purpose of the cache module, just by reading trough it?

lib/cache.js Outdated
class Cache {
constructor(dir) {
this.dir = dir || path.join(__dirname, '..', '.ncu', 'cache');
this.originals = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd would have prefer this to be a Map instead of plain object, for readability.

}
});

it('should cache sync restuls', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo, results.

assert.strictEqual(cached, expected);
});

it('should cache async restuls', async() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

@@ -55,3 +63,66 @@ describe('JobParser', () => {
assert.deepStrictEqual([...expected.entries()], [...results.entries()]);
});
});

describe('Jeknins', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo Jenkins.

bin/ncu-ci Outdated
PRBuild, BenchmarkRun, CommitBuild, jobCache, parseJobFromURL, constants
PRBuild, BenchmarkRun, CommitBuild, parseJobFromURL,
constants, JobParser
// , jobCache
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was left by mistake.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops, i was looking trough each commit.

bin/ncu-ci Outdated
const Request = require('../lib/request');
const CLI = require('../lib/cli');
const yargs = require('yargs');

// This is used for testing
// Default cache dir is ${ncu-source-dir}/.ncu/cache
jobCache.enable();
// jobCache.enable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need get rid this block now that this is not required for tests?

@joyeecheung
Copy link
Member Author

@priyankp10 Thanks for the review! The cache is there for development: e.g. when you are working on the pattern-matching rules you would not want to wait for the tool to grab all the data from Jenkins each time you run it.

@joyeecheung joyeecheung merged commit bb0d70f into nodejs:master Jun 1, 2018
johnfrench3 pushed a commit to johnfrench3/core-utils-node that referenced this pull request Nov 2, 2022
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for nodejs/node-core-utils#161
- Updates a few CI link patterns
renawolford6 added a commit to renawolford6/node-dev-build-core-utils that referenced this pull request Nov 10, 2022
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for nodejs/node-core-utils#161
- Updates a few CI link patterns
Developerarif2 pushed a commit to Developerarif2/node-core-utils that referenced this pull request Jan 27, 2023
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for nodejs/node-core-utils#161
- Updates a few CI link patterns
gerkai added a commit to gerkai/node-core-utils-project-build that referenced this pull request Jan 27, 2023
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for nodejs/node-core-utils#161
- Updates a few CI link patterns
patrickm68 added a commit to patrickm68/NodeJS-core-utils that referenced this pull request Sep 14, 2023
- Put the PR URL parsing logic in links.js and reuse it
- Differentiate PR and commit jobs in preparation for nodejs/node-core-utils#161
- Updates a few CI link patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants