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

feat(git-node): add git node vote #704

Merged
merged 9 commits into from
Sep 3, 2023
Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jun 14, 2023

This PR adds git node vote command, which can be used to participate to a vote using Caritat. The idea of integrating that in ncu is that TSC folks are very likely to already have ncu installed and configured on their local machine, reducing the possible friction for a user to cast a vote, as they don't need to provide their GitHub credentials to make the API calls.

Code reviews are welcome, note that we should wait for the transfer of Caritat npm package to the @node-core scope to be completed before landing.

@aduh95 aduh95 added do not land PR's that are on hold, and shouldn't land git-node new tool New tool that could be added to node-core-utils labels Jun 14, 2023
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f30cdba) 83.38% compared to head (0a4d41e) 83.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #704   +/-   ##
=======================================
  Coverage   83.38%   83.38%           
=======================================
  Files          37       37           
  Lines        4158     4158           
=======================================
  Hits         3467     3467           
  Misses        691      691           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

lib/voting_session.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@aduh95 aduh95 removed the do not land PR's that are on hold, and shouldn't land label Jun 28, 2023
lib/voting_session.js Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor Author

aduh95 commented Jun 29, 2023

@nodejs/node-core-utils given this PR is relatively large, it would help to have some extra pair(s) of eyes to review it :)

@anonrig
Copy link
Member

anonrig commented Jun 29, 2023

Since this is specific to tsc, why not make it “git node tsc-vote”?

@aduh95
Copy link
Contributor Author

aduh95 commented Jun 29, 2023

Since this is specific to tsc, why not make it “git node tsc-vote”?

It's not specific to the TSC, any other team (or anyone really) is welcome to use it.

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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


export const command = 'vote [prid|options]';
export const describe =
'Manage the current landing session or start a new one for a pull request';
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem quite right ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

if (this.postComment) {
const { html_url } = await this.req.json(`https://api.github.com/repos/${this.owner}/${this.repo}/issues/${this.prid}/comments`, {
agent: this.req.proxyAgent,
method: 'POST',
Copy link
Member

@joyeecheung joyeecheung Jun 29, 2023

Choose a reason for hiding this comment

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

I think this should require additional permissions from the token other than the ones specified by https://github.com/nodejs/node-core-utils/blob/main/README.md#setting-up-github-credentials? So the docs should probably be updated and/or there should be a hint if this returns a permission error code (403?)?

components/git/vote.js Show resolved Hide resolved
lib/voting_session.js Outdated Show resolved Hide resolved
aduh95 and others added 2 commits June 30, 2023 10:44
Co-authored-by: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
README.md Outdated Show resolved Hide resolved
docs/git-node.md Outdated Show resolved Hide resolved
lib/voting_session.js Outdated Show resolved Hide resolved
aduh95 and others added 2 commits July 1, 2023 13:43
Co-authored-by: Michaël Zasso <targos@protonmail.com>
@aduh95 aduh95 merged commit 7b9d962 into nodejs:main Sep 3, 2023
12 of 13 checks passed
@aduh95 aduh95 deleted the git-node-vote branch September 3, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git-node new tool New tool that could be added to node-core-utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants