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

Feature: scaffolder-backend-module-utils for parsing should have an option to not fail if file is not found #1608

Open
bbckr opened this issue Sep 10, 2024 · 0 comments
Labels
kind/enhancement New feature or request

Comments

@bbckr
Copy link

bbckr commented Sep 10, 2024

Feature Suggestion

Love the scaffolder actions yall have published so far. After a bit of usage in our own templates, I would like to suggest that the parse action does not fail the step if the file set in input.path does not exist. In cases where the file is not found, it should default to what the user sets.

Possible Implementation

Update roadiehq:utils:fs:parse to accept a new, optional input called default. When not provided, it will continue to fail the pipeline. If provided, when the file is not found it will just return the default as output.content.

Context

In many cases for our software templates, it is not guaranteed that the file will exist, but it is guaranteed that the file we are merging it with will. Rather than adding an extra step to ensure the file exists before trying to parse then merge it, this could simplify the software template pipeline if we are just allowed to set a default value.

Let me know if you need more context. If/when we agree on an implementation, I also wouldn't mind throwing up a PR for this.

@bbckr bbckr added the kind/enhancement New feature or request label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant