generator icon indicating copy to clipboard operation
generator copied to clipboard

Generator doesn't pull template from private repo

Open alextrs opened this issue 4 years ago • 15 comments

Describe the bug

After upgrade to 1.6.0 version from 1.1.4, ag stopped to recognize npm configuration to use private repository

How to Reproduce

install @asyncapi/[email protected]

configure NPM to use private repository using:
npm config set registry <path to registry>

try to generate code
ag ./server.yaml @repo/template --force-write --output ./out

see error - Error: 404 Not Found - GET https://registry.npmjs.org/<template in private repo> - Not found

install @asyncapi/[email protected]
ag ./server.yaml @repo/template --force-write --output ./out
Done! ✨

Expected behavior

Ag should pull template from private repository

alextrs avatar Mar 16 '21 22:03 alextrs

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

github-actions[bot] avatar Mar 16 '21 22:03 github-actions[bot]

@alextrs the reason is that with 1.2 we no longer use global npm to install templates, we had to change it to not only support the latest node and npm7 but also to solve some installation-related issues.

tbh, we were not aware people use private registries with generator, so sorry for breaking your functionality.

now we use Arborist for installation (https://github.com/asyncapi/generator/blob/master/lib/generator.js#L371). Luckily what you need is supported -> https://github.com/npm/arborist#usage

we would just need to not only enable Arborist configuration on API level but also figure out how to do it for the CLI, how to name parameters.

Would appriciate some help here

derberg avatar Mar 17 '21 12:03 derberg

Hey all, +1 for this use case.

Either enabling the CLI to use private registries w/ the generator or publishing an officially supported image that includes a bundle of all the officially supported templates would make it easier to run the generator on build servers in any enterprise environment that restricts internet access.

I.e. security team needs to vet either each individual template image or the officially supported image w/ all the templates

andrew-j-roberts avatar May 10 '21 16:05 andrew-j-roberts

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Jul 10 '21 00:07 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Sep 25 '21 00:09 github-actions[bot]

would be great if someone could contribute this feature, happy to guide

derberg avatar Sep 27 '21 13:09 derberg

I would be happy to take it, just encounter the issue myself

rluvaton avatar Oct 03 '21 06:10 rluvaton

A quick workaround would be to install the packages locally (not with the -g flag) and run the generate again

rluvaton avatar Oct 03 '21 06:10 rluvaton

@rluvaton 🚀

why do you need workarounds? as I see Arborist supports passing auth token, we just need to enable it on API level and in the code

derberg avatar Oct 04 '21 10:10 derberg

I meant workaround until we solve the problem

rluvaton avatar Oct 04 '21 10:10 rluvaton

ah, sorry, you are right, this should work

derberg avatar Oct 04 '21 10:10 derberg

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Feb 02 '22 00:02 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Jun 04 '22 00:06 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Oct 06 '22 00:10 github-actions[bot]

This is still valid. I'm happy to help anyone who wants to contribute it

derberg avatar Oct 11 '22 10:10 derberg

I want to contribute in this one.

toukirkhan avatar Oct 11 '22 14:10 toukirkhan

@toukirkhan thanks ❤️ there was already one attempt to fix it but PR was discontinued. You can still have a look at it, and the comments I left there, it will give you some guidance -> https://github.com/asyncapi/generator/pull/673

derberg avatar Oct 12 '22 08:10 derberg

Cool

toukirkhan avatar Oct 12 '22 08:10 toukirkhan

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Feb 10 '23 00:02 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar Aug 04 '23 00:08 github-actions[bot]

Scope is that someone has to pick up https://github.com/asyncapi/generator/pull/877 and replicate what was done there, and improve stuff from comments

derberg avatar Oct 25 '23 15:10 derberg

Would like to work on this issue.

mhmohona avatar Nov 01 '23 14:11 mhmohona

Bounty Issue's End Of Life (EOL): 2024-02-29 23:59:59 UTC-12:00

aeworxet avatar Nov 07 '23 07:11 aeworxet

.@derberg I want to start on this issue. Can i take this.? I have already valid MR merged more than 3 in asyncpai. https://github.com/search?q=is%3Apr+author%3AAayushSaini101+org%3Aasyncapi+is%3Amerged&type=pullrequests

AayushSaini101 avatar Nov 07 '23 11:11 AayushSaini101

@derberg I want to start on this issue. Can i take this.? I have already valid MR merged more than 3 in asynccpai

I have made changes how can I debug? I need some guidelines to debug. Can you please tell

AayushSaini101 avatar Nov 07 '23 12:11 AayushSaini101

Hey, can I work on this issue?

chinma-yyy avatar Nov 07 '23 15:11 chinma-yyy

Hey! Can I work on this issue? I beleive I can do this

codingmickey avatar Nov 08 '23 04:11 codingmickey

Hey @derberg, I would like to work on this.

I am an active contributor at AsyncAPI. Here is the list of my merged PRs.

Proposal

Taking PR #877 as a base, we have to make these changes:

1. Add typedef for RegistryOptions: Create a typedef declaration for the RegistryOptions object.

/**
 * @typedef {Object} RegistryOptions
 * @property {String} url - Npm registry URL.
 * @property {String} [username] - Username for npm registry authentication.
 * @property {String} [password] - Base64 encoded password for npm registry authentication.
 * @property {String} [token] - Auth token for npm registry authentication.
 */

2. Update the Constructor JSDoc: we will get a nice API docs generated * @param {RegistryOptions} [options.registry] - Optional npm registry configuration.

princerajpoot20 avatar Nov 08 '23 08:11 princerajpoot20

Only 2 candidates can be considered for this issue, it is @AayushSaini101 and @princerajpoot20 Looking at bounty rules:

Think on the task, make sure that you understand how to do it and CAN do it

Although they did not have to open a PR (did it to quick), they proved he understands the scope and what he is signing up for. Hint for others in future, you can do the same without opening a PR, but just writing transparently in the comment what do you know about the issue

Regular contributors (GitHub users who have three or more Pull Requests merged throughout the AsyncAPI GitHub Organization, checked with https://github.com/search?q=is%3Apr+org%3Aasyncapi+is%3Amerged+author%3Agh_username)

Both folks also made it super easy for me to quickly click on the link to confirm if they already had 3PR merged


Instead of going with some "coin flipping" solution, I decided to give this issue to @AayushSaini101 as he is not involved in any other AsyncAPI program (like mentorship)

derberg avatar Nov 13 '23 14:11 derberg

Bounty Issue's Timeline

Complexity Level Assignment date (by GitHub) Start date (by BP rules) End date (by BP rules) Draft PR submission Final PR submission Final PR merge
Medium 2023-11-13 2023-11-20 2023-12-29 2023-12-01 2023-12-15 2023-12-29
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.

aeworxet avatar Nov 14 '23 06:11 aeworxet