-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: support symbolic linked pipelines to avoid repetition #580
feat: support symbolic linked pipelines to avoid repetition #580
Conversation
021a935
to
e331a09
Compare
that's a good head-up. how about a short todo comment in the code to refactor this once we drop support for older Python versions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider adding a test for it. If you need any help let me know
Sure I can add a note, I actually had one originally but I moved it to the description of the pull-request. |
How would you suggest we test it? creating a pipeline that's just a symlink of another and expect same result? 🤔 |
e331a09
to
7f809e8
Compare
yes. feel free to commit the symlink to https://github.com/bakdata/kpops/tree/main/tests/pipeline/resources |
7f809e8
to
fef7b47
Compare
the new test itself would make sense in https://github.com/bakdata/kpops/blob/main/tests/pipeline/test_generate.py edit: I believe ideally we would need to cover the following scenarios:
wdyt? |
Mmmm, ok, more than I thought, let me try to cover those scenarios. |
4120a43
to
cd3b55d
Compare
As suggested I've included 3 types of symlinks to the tests:
the test just validates the rendered results is as the original sources of the symlinks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution
in case of similar pipelines are used for different scenarios
cd3b55d
to
6ec2026
Compare
@disrupted I assume you'll merge it when ready, thank you for the inputs. |
## why While using kpops and trying to reduce the amount of copy/pasting required to configure multi-tenant configuration I found that _symbolic links_ would cause kpops execution to break. ## what Replaces existing `Path.blob` with `blob.blob` and resolves the real file location so no other changes are required for it to be compatible with existing logic. > [!NOTE] > In python 3.13 symbolic links are supported [docs.python.org/3.13#pathlib.Path.glob](https://docs.python.org/3.13/library/pathlib.html#pathlib.Path.glob), probably it would be as easy as follows: > `yield from sorted(pipeline_path.glob(f"**/{PIPELINE_YAML}", recurse_symlinks=True))`
why
While using kpops and trying to reduce the amount of copy/pasting required to configure multi-tenant configuration I found that symbolic links would cause kpops execution to break.
what
Replaces existing
Path.blob
withblob.blob
and resolves the real file location so no other changes are required for it to be compatible with existing logic.Note
In python 3.13 symbolic links are supported docs.python.org/3.13#pathlib.Path.glob, probably it would be as easy as follows:
yield from sorted(pipeline_path.glob(f"**/{PIPELINE_YAML}", recurse_symlinks=True))