generator
generator copied to clipboard
Generator doesn't pull template from private repo
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
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.
@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
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
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:
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:
would be great if someone could contribute this feature, happy to guide
I would be happy to take it, just encounter the issue myself
A quick workaround would be to install the packages locally (not with the -g flag) and run the generate again
@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
I meant workaround until we solve the problem
ah, sorry, you are right, this should work
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:
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:
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:
This is still valid. I'm happy to help anyone who wants to contribute it
I want to contribute in this one.
@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
Cool
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:
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:
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
Would like to work on this issue.
Bounty Issue's End Of Life (EOL): 2024-02-29 23:59:59 UTC-12:00
.@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
@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
Hey, can I work on this issue?
Hey! Can I work on this issue? I beleive I can do this
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.
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)
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 |