FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor tests, update dependencies and Project API by mathieudutour · Pull Request #401 · github-tools/github · GitHub

refactor tests, update dependencies and Project API - #401

Merged
clayreimann merged 42 commits into
github-tools:masterfrom
mathieudutour:master
Nov 30, 2016
Merged

refactor tests, update dependencies and Project API#401
clayreimann merged 42 commits into
github-tools:masterfrom
mathieudutour:master

Conversation

mathieudutour commented Nov 18, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

That's a lot of changes. Tell me if you are interested, I'll clean the history and the package.json

codecov-io commented Nov 18, 2016
edited
Loading

Copy link
Copy Markdown

Current coverage is 90.02% (diff: 93.84%)

No coverage report found for master at 78a98b1.

Powered by Codecov. Last update 78a98b1...f998a39

clayreimann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the great work!

The only question I have is what did you brea? I don't see what changes require a major version bump.

Comment thread .travis.yml
node_js:
- '6'
- '5'
- '4'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How much longer is node4 supported? Maybe we don't drop support for node4 just yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

we are not dropping the support for node4, just node 0.12 and earlier. I removed it from the test cause there were some issues with running the test 3 times in parallel. But maybe we should test on node4 only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Comment thread README.md Outdated
## GitHub Tools

The team behind Github.js has created a whole organization, called [GitHub Tools](https://github.com/github-tools),
dedicated to GitHub and its API. In the near future this repository could be moved under the GitHub Tools organization

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Was moved to org

Comment thread lib/Repository.js
* @param {number|string} number - the number of the pull request to update
* @param {Object} options - the pull request description
* @param {Requestable.callback} [cb] - will receive the pull request information
* @return {Promise} - the promise for the http request

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Lolz

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@clayreimann You were asking about a breaking change that would necessitate a major version bump. This would be it.

Comment thread lib/Requestable.js
const url = this.__getURL(path);
const headers = this.__getRequestHeaders(raw);

const AcceptHeader = (data || {}).AcceptHeader;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

acceptHeader?

mathieudutour Nov 21, 2016
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

the header is call Accept so I wasn't sure. I have no strong feeling about it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think @clayreimann is getting at the usage of PascalCasing instead of camelCasing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yes I understood

Comment thread package.json Outdated
"name": "github-api",
"version": "2.4.0",
"name": "@mathieudutour/github-api",
"version": "3.2.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this diff still relevant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

it's not, I will roll back those changes. I wasn't sure you were interested in merging such a PR so I waited for that first ;)

Comment thread test/team.spec.js
(found, member) => member.login === testUser.USERNAME || found,
false
);
const hasTestUser = members.some((member) => member.login === testUser.USERNAME);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍 Yay conciseness!

Comment thread release.sh Outdated
# switch back to master, build and publish
git checkout master
npm run build
npm publish

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Isn't this done by CI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

indeed, I'll roll back also

Comment thread .travis.yml
cache:
directories:
- node_modules
before_install: npm install -g npm@latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What's the reasoning for not using the latest version of npm?

Comment thread README.md
dedicated to GitHub and its API. In the near future this repository could be moved under the GitHub Tools organization
as well. In the meantime, we recommend you to take a look at other projects of the organization.

## Samples

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What's the thought behind removing all this documentation? Are you proposing we drop the link to the generated Docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's not removed, it's rearranged to fit https://github.com/noffle/art-of-readme

Comment thread README.md

```javascript
import GitHub from 'github-api';
var GitHub = require('github-api');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why downgrade from ECMA2015?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

hum, because for people who are not using babel/ES6, it's an additional cognitive load which can be avoided. For people using ES6, I'm quite sure they know how to use const instead of var.
But again, no strong feeling and happy to roll back if you prefer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

My opinion is that ECMA2015 is spec now, so there's no need to downgrade.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sure, but var is not deprecated in anyway, so if we can help people understand the repo, I think it's best, regardless of wether it's matching style guide or not, don't you think? (see #392)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

My idea was, and hope is, that we can have at least one example of each of: require vs import and then vs cb to give people the full flavor of the API.

That being said I think that perhaps that means most of our examples are import + then with an example included toward the end of require + cb.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That might be a solution. Feel free to commit on directly here

Comment thread README.md

// basic auth
const gh = new GitHub({
var gh = new GitHub({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Again downgrading from ECMA2015?

Comment thread README.md
});

const me = gh.getUser();
var me = gh.getUser(); // no user specified defaults to the user for whom credentials were provided

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Another downgrade from ECMA2015, I'll stop mentioning all the ones I see now.

Comment thread lib/Repository.js
* @param {number|string} number - the number of the pull request to update
* @param {Object} options - the pull request description
* @param {Requestable.callback} [cb] - will receive the pull request information
* @return {Promise} - the promise for the http request

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@clayreimann You were asking about a breaking change that would necessitate a major version bump. This would be it.

Comment thread test/issue.spec.js Outdated
let remoteIssues;

before(function() {
before(function(done) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Mocha allows you to return a promise chain instead of passing the done callback.

Comment thread test/project.spec.js
.getUser()
.createRepo({name: testRepoName})
.then(wait())
.then(wait(5000))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I generally find arbitrary delays like this in tests to be brittle. Perhaps a better solution is to poll for the repo until it comes back successfully.

Comment thread README.md

```javascript
import GitHub from 'github-api';
var GitHub = require('github-api');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

My opinion is that ECMA2015 is spec now, so there's no need to downgrade.

Comment thread lib/Requestable.js
const url = this.__getURL(path);
const headers = this.__getRequestHeaders(raw);

const AcceptHeader = (data || {}).AcceptHeader;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think @clayreimann is getting at the usage of PascalCasing instead of camelCasing.

Comment thread test/repository.spec.js Outdated
it('should write to repo', function(done) {
remoteRepo.writeFile('master', fileName, initialText, initialMessage, assertSuccessful(done, function() {
remoteRepo.getContents('master', fileName, 'raw', assertSuccessful(done, function(err, fileText) {
wait().then(() => remoteRepo.getContents('master', fileName, 'raw',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why the wait?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sometimes the writeFile succeed even though github didn't really create the file yet and the getContents call fails with 404. Wait is there to give time to Github to settle down

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Blind wait's a generally very brittle. Can you pull github for the file and if it doesn't show up within 20 seconds then fail?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Indeed, I'll see if I can write an easy to use helper. (This can be done in another PR though)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Agreed, I'm fine with it in another PR as well.

Copy link
Copy Markdown
Member

For the changelog generation should we have all these commits squashed with the commit message chore: fix tests

Copy link
Copy Markdown
Member

There's nothing here that I really object to, @mtscout6 look good to you too?

mtscout6 commented Nov 29, 2016
edited
Loading

Copy link
Copy Markdown
Member

Just the rebase and squash for the change log generation. If that's still a thing for this repo.

Copy link
Copy Markdown
Contributor Author

How is the changelog generation working exactly?

clayreimann commented Nov 30, 2016 via email

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

Very well, I thought it was auto generated from the commit messages. Never mind then this is good to go.

clayreimann merged commit 6ec1d0b into github-tools:master Nov 30, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL