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
[Feedback Wanted] Evaluate scaffolder templates through dry-run API #14280
Comments
That's the functionality that the work is based on, but in an automatable fashion. I've not done a lot of testing of the editor, as it often bailed on the upload limit for our instance and templates. Once we update to 1.7, I'll do more testing. E.g., I just tested downloading the edited files, and the The way I think about it is that the editor is really going to shine if you're editing the questionnaire, while the cli tool would shine if you made edits on the template skeleton, and you want to verify that linters and tests and all that work for a given input. And then there's the CI part, and we did contemplate to use something like cypress to go through the UI on the edit interface. But then we'd need to see how to log a CI user in, which I ran away from. |
Can this be closed with #13991 merged in? |
This issue is to collect feedback on that document, so no. |
Forgot about the relation between things here, got a bit confused by the format I think x) I updated the title to hopefully be a bit more clear about the intent. Perhaps it would be best to update the issue body with references to the code in contrib as well? |
Hey all, |
Yes, it does have node.js dependencies, but it's not required to be run on a machine with backstage installed. To avoid saying node twice for different things. The machine you run it on does need network access to the machine running backstage, though. So it's low on local dependencies, but whether you call that stand-alone or not would be up to you ;-) |
Hey, @Pike, basically I am having issues with running this on local machine, due to following errors:
I suspected I am missing a
and then I get
I know I am doing something wrong or missing some npm dependencies, but not sure which? I am on node scaffolder-dry.js http://remotehost/ <template-directory> template.yml <output-directory> Excuse my ignorance if it is something obvious :) |
Would also like some clarification on how to use the script, not super familiar with typescript and couldn't get it working while messing around with it. My apologies if something is obvious. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Let's keep this open. |
For a bit more context, with Cookiecutter we had a simple way to test templates locally: just run We also used Cookiecutter in CI pipelines to build some basic tests. At least, making sure the template compiled and didn't have any errors. With the switch to nunjucks, we don't have any good way to test locally or in CI. This is a big step backward for us in terms of functionality. |
Could really use some more details on how this is meant to be run. Not clear on why this is a .md. As a .ts the path to the package.json may have changed since this was created, but the package.json it appears to be referencing is not configured properly to execute this as a module. Not currently able to get this to function. |
@Gladdstone I got it working, here's how I modified it: https://gist.github.com/rmartine-ias/4fe26f27b6d520806bd26fa0f1607fa2 If this is missing anything, let me know. It's not super pretty, but it runs.
I got |
I've been bumping into an issue recently using the template editor directly, it appears that when using The unescaped form works fine when using templates for real, it only appears to cause an issue when sent to the dry-run endpoint. I'm guessing a serialisation issue perhaps? Using roadie and they confirmed they weren't seeing anything in their logs regarding the forbidden error. Happy to report this as a separate issue, just figured some people might end up i this thread. Btw, having this is fantastic, so I'm hopeful that work will continue and build out a CLI tool to support along the lines of the scripts referenced above. |
@electrofelix Could you make a separate issue with some reproduction steps for that? |
Any chance we can increase the priority for this CLI to be official? It's an amazing tool |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
not stale, still want this |
@Pike what do you think about moving this to an official |
Sounds like a good idea to me. There might be issues with the permissions framework, but I'm not sure if they're bound to me often folding the backend token back in. I've got a local branch where I remove both the Another thing I end up doing often is to actually create a git commit. The Also the user is different in dry run. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
naggitynagnag |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
naggitynagnag |
@Pike that aught to keep the stalebot away. Still blocked on the auth issue at the minute though, which we should hopefully get some time in Q1 to start taking a look at. |
Status: Open for comments
Need
Template developers want to test their in-development templates against their installation of backstage.
Proposal
Have a CLI script that uses the dry-run API of a backstage installation, and serialize the created workdir to local disk for the developer to test.
With some auth trickery, this could also be used for CI on template repositories.
Check out a possible variant of such a script in the contrib documentation, https://github.com/backstage/backstage/tree/master/contrib/scaffolder.
Alternatives
Risks
This doesn't actually test the survey/questionnaire part of the template.
The text was updated successfully, but these errors were encountered: