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

Generator doesn't pull template from private repo #538

Closed
alextrs opened this issue Mar 16, 2021 · 40 comments · Fixed by #1061
Closed

Generator doesn't pull template from private repo #538

alextrs opened this issue Mar 16, 2021 · 40 comments · Fixed by #1061
Assignees
Labels
bounty AsyncAPI Bounty program related label bounty/2023-Q4 AsyncAPI Bounty program related label level/advanced AsyncAPI Bounty program related label released

Comments

@alextrs
Copy link

alextrs commented Mar 16, 2021

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/generator@1.6.0

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/generator@1.1.4
ag ./server.yaml @repo/template --force-write --output ./out
Done! 

Expected behavior

Ag should pull template from private repository

@alextrs alextrs added the bug Something isn't working label Mar 16, 2021
@github-actions
Copy link
Contributor

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.

@derberg
Copy link
Member

derberg commented Mar 17, 2021

@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

@andrew-j-roberts
Copy link

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

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label Jul 10, 2021
@derberg derberg removed bug Something isn't working stale labels Jul 26, 2021
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label Sep 25, 2021
@derberg derberg removed the stale label Sep 27, 2021
@derberg
Copy link
Member

derberg commented Sep 27, 2021

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

@rluvaton
Copy link

rluvaton commented Oct 3, 2021

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

@rluvaton
Copy link

rluvaton commented Oct 3, 2021

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

@derberg
Copy link
Member

derberg commented Oct 4, 2021

@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

@rluvaton
Copy link

rluvaton commented Oct 4, 2021

I meant workaround until we solve the problem

@derberg
Copy link
Member

derberg commented Oct 4, 2021

ah, sorry, you are right, this should work

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2022

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

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 ❤️

@github-actions github-actions bot added the stale label Feb 2, 2022
@derberg derberg removed the stale label Feb 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2022

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

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 ❤️

@github-actions github-actions bot added the stale label Jun 4, 2022
@derberg derberg removed the stale label Jun 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

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

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 ❤️

@github-actions github-actions bot added the stale label Oct 6, 2022
@derberg
Copy link
Member

derberg commented Oct 11, 2022

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

@aeworxet
Copy link

aeworxet commented Nov 7, 2023

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

@AayushSaini101
Copy link
Contributor

AayushSaini101 commented Nov 7, 2023

.@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
Copy link
Contributor

@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

@chinma-yyy
Copy link

Hey, can I work on this issue?

@codingmickey
Copy link

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

@princerajpoot20
Copy link
Member

princerajpoot20 commented Nov 8, 2023

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.

@derberg
Copy link
Member

derberg commented Nov 13, 2023

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)

@aeworxet
Copy link

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.

@AayushSaini101
Copy link
Contributor

@derberg I have raised a sample PR Taking PR base of #877 . I have also understood the workflow of the generator

@aeworxet
Copy link

Due to unpredicted circumstances that could not be foreseen and are beyond the control of the AsyncAPI Maintainer (@derberg), the Bounty Issue's Timeline is frozen for an indefinite amount of time.

@aeworxet
Copy link

aeworxet commented Dec 6, 2023

AsyncAPI Maintainer (@derberg) had regained a confident online presence in Slack, so the Bounty Issue's Timeline is extended by four weeks.

Bounty Issue's Timeline Extended

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 2024-01-26 2023-12-29 2024-01-12 2024-01-26
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.

@aeworxet
Copy link

@asyncapi/bounty_team

@aeworxet
Copy link

aeworxet commented Jan 4, 2024

AsyncAPI Maintainer (@derberg) was absent online in Slack for one period of three working days in a row, so all remaining target dates of the Bounty Issue's Timeline are extended by two calendar weeks.

Bounty Issue's Timeline Extended

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 2024-02-09 2024-01-12 2024-01-26 2024-02-09
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.

@derberg
Copy link
Member

derberg commented Jan 8, 2024

@aeworxet hey, thanks for reaching out about that topic. So yeah, I'd like to propose that we change this issue from Medium to Advanced. When medium level for this issue was assigned, I forgot to take into account advanced testing that will have o be added in a PR to test properly new functionality. I hope we have budget and can pay @AayushSaini101 at the end of the task for advanced work.

@aeworxet
Copy link

aeworxet commented Jan 8, 2024

Upon request of the AsyncAPI Maintainer (@derberg) Complexity Level of this Bounty Issue has been reclassified to Advanced and its Timeline changed.

Bounty Issue has been Reclassified and its Timeline Changed

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
Advanced 2023-11-09 2023-11-13 2024-02-23 2024-01-19 2024-02-09 2024-02-23
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.

@derberg
Copy link
Member

derberg commented Jan 18, 2024

confirming that this is completed, great work 🚀
@aeworxet please share how @AayushSaini101 should apply for payout

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@aeworxet
Copy link

Bounty Issue Completed 🎉

Please go to the AsyncAPI's OpenCollective page and submit an invoice for USD 400.00 with the subject Bounty generator#538, tag bounty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label bounty/2023-Q4 AsyncAPI Bounty program related label level/advanced AsyncAPI Bounty program related label released
Projects
Status: Completed