Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Conversation

@TheDelta
Copy link
Contributor

@TheDelta TheDelta commented Aug 11, 2022

Checklist

Affected core subsystem(s)
core & cli

Description of change
Added a test parameter, to allow one CLI execution to handle different files based on conditions.
For example, this allows to use different settings based on filename, etc.

It is a bit old and I'm not sure if I'm feature complete yet, would love to get some feedback and suggestions if I should add something.

@MarcusCemes
Copy link
Owner

Thanks for the PR.

I've always wanted to add conditional execution of different pipes, similar to what GitHub actions have for their steps, the difficulty in implementing this properly is maintaining compatibility with YAML and JSON configuration for CLI usage where it's impossible to embed lambda functions, such as with JS configs.

The regex approach seems interesting, although I imagine that this is only to test that the source filename matches a particular pattern, and doesn't other metadata into account?

@MarcusCemes MarcusCemes changed the title Feat/pipeline test param Conditional pipe execution Aug 11, 2022
@MarcusCemes MarcusCemes added the enhancement New feature or request label Aug 11, 2022
@MarcusCemes MarcusCemes self-assigned this Aug 11, 2022
@TheDelta
Copy link
Contributor Author

Exactly, regex is for filename only. I first wanted to do a glob handling but realized it would require a dependency and I think regexp should be fine.
For more advanced stuff, the callback function (PipelineTestCallback ) can be used to check for metadata.

I try to test it on my project today to see if it works, it has been a few weeks since I was working on it and I'm unsure if I missed something (thats why it's still in draft mode :D)

@TheDelta
Copy link
Contributor Author

So far this only works for the CLI TypeScript version, I don't use YAML or anything atm, but I guess it shouldn't be an issue to have more advanced handling only for TypeScript CLI atm.
Or we must rework this probably^^

@TheDelta
Copy link
Contributor Author

I added input filters, to filter out initial files before the processing starts.
This allows to ignore certain file names, types, etc.

@TheDelta
Copy link
Contributor Author

I need some more testing but I noticed somehow that the pipelines are very slow and I'm not sure if it's my logic / chain of multuple sharp commands with toBuffer, etc or if something is slowing it down. Eventually also the amount of file(size) is simply taking that long.
Need to run some traces when I find some time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants