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

[TRIGGER] npm new release #12070

Closed
gilmeir-arnac opened this issue May 22, 2024 · 9 comments · Fixed by #12149
Closed

[TRIGGER] npm new release #12070

gilmeir-arnac opened this issue May 22, 2024 · 9 comments · Fixed by #12149
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed triaged For maintainers: This issue has been triaged by a Pipedream employee trigger / source New trigger / source request

Comments

@gilmeir-arnac
Copy link

Report to slack on new package (or scope) releases to npm.

https://docs.npmjs.com/cli/v10/commands/npm-hook
https://github.com/npm/registry/blob/main/docs/hooks/endpoints.md

@gilmeir-arnac gilmeir-arnac added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed trigger / source New trigger / source request labels May 22, 2024
@vunguyenhung
Copy link
Collaborator

Confirmed, no npm new release exists
image

Adding this to backlog

@vunguyenhung vunguyenhung added this to To Do in Component (Source and Action) Backlog via automation May 23, 2024
@dylburger dylburger added the triaged For maintainers: This issue has been triaged by a Pipedream employee label May 23, 2024
@malexanderlim malexanderlim moved this from To Do to Prioritized in Component (Source and Action) Backlog May 24, 2024
@jcortes jcortes self-assigned this May 28, 2024
@jcortes jcortes moved this from Prioritized to Doing in Component (Source and Action) Backlog May 28, 2024
@jcortes
Copy link
Collaborator

jcortes commented May 28, 2024

Hi @gilmeir-arnac do you know by any change if the endpoint is working? because I'm not even getting any response by doing something like as an example:

curl -X POST 'https://registry.npmjs.org/-/npm/v1/hooks/hook/' \
-H 'Content-Type: application/json' \
-d '{
  "type": "package",
  "name": "react",
  "endpoint": "https://6a70ce29674a2fbe027ff18ebd5f6be5.m.pipedream.net",
  "secret": "fd752205-4f86-488c-9c08-a5d5e2a4e82d"
}'

and if I try to make a request using the component from Pipedream I get:

"status": 401,
"statusText": "Unauthorized",

cc @michelle0927 @vunguyenhung

in any case if you want to try the component is here #12149

By the way I also tried the suggestion in this PR npm/registry#31 and I got the following message in a html response

Sorry, you have been blocked
You are unable to access npmjs.com 

Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.
 Cloudflare Ray ID: 88b17f861a64884  Performance & security by Cloudflar

@jcortes jcortes added the blocked Issue is blocked pending a resolution label May 28, 2024
@michelle0927
Copy link
Collaborator

@jcortes I think the endpoints may require authentication with a username and password. https://github.com/npm/registry/blob/main/docs/user/authentication.md#how-to-authenticate

@jcortes
Copy link
Collaborator

jcortes commented May 29, 2024

Hi @michelle0927 I tried with basic auth and didn't work either

Update

Actually it worked with OTP number!

Seems like in order to make it work we need a paid individual or organizational npm account according to this blog https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm

If you have a paid individual or organizational npm account, you can start using hooks right now.

I've even tried with the CLI commands and didn't get any event notifications at all

cc @malexanderlim @gilmeir-arnac

@gilmeir-arnac
Copy link
Author

@jcortes same here, that's why I was looking if pipedream has it 😉
Eventually I implemented it with periodic triggers in pipedream, it uses the datastore to cache the latest version it found and reported to slack.

with npm cli

npm view $PACKAGE_NAME@latest version

with node

import fetch from 'npm-registry-fetch';

const response = await fetch.json(`/${packageName}/latest`);
console.log(response.version);

You can lookup my project id proj_AVs3J6m.

@jcortes
Copy link
Collaborator

jcortes commented Jun 6, 2024

Hi @gilmeir-arnac can you send me the shared link via slack please? my username is @jcortes in any case

@jcortes jcortes moved this from Blocked to Doing in Component (Source and Action) Backlog Jun 17, 2024
@jcortes jcortes removed the blocked Issue is blocked pending a resolution label Jun 17, 2024
@jcortes
Copy link
Collaborator

jcortes commented Jun 17, 2024

Hi @gilmeir-arnac I've just pushed the update so right now we have a source component (Trigger) named New Package Version which as you requested it's a polling trigger where we basically are fetching the package metadata to get the latest version creating an event whenever a new version is published, let me know if that works! cc @malexanderlim

@jcortes jcortes moved this from Doing to Ready for PR review in Component (Source and Action) Backlog Jun 17, 2024
@lcaresia lcaresia moved this from Ready for PR review to Ready for QA in Component (Source and Action) Backlog Jun 18, 2024
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung vunguyenhung moved this from In QA to Ready for QA in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung vunguyenhung moved this from In QA to Changes Required in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check the test report below for more information
https://vunguyenhung.notion.site/TRIGGER-npm-new-release-642dd6638bef41aeb1d9d77a99dfa7ed

@jcortes jcortes moved this from Changes Required to Ready for QA in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung vunguyenhung moved this from In QA to Ready for release in Component (Source and Action) Backlog Jun 19, 2024
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/TRIGGER-npm-new-release-642dd6638bef41aeb1d9d77a99dfa7ed

Component (Source and Action) Backlog automation moved this from Ready for release to Done Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed triaged For maintainers: This issue has been triaged by a Pipedream employee trigger / source New trigger / source request
Development

Successfully merging a pull request may close this issue.

5 participants