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

refact: support absolute paths in local source manager #450

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

masci
Copy link
Member

@masci masci commented Feb 6, 2025

This PR introduced the concept that the path for a service with a local source is relative to the deployment file. For example, if you have a deployment file /foo/bar/deployment.yml containing the following:

services:
  dummy_workflow:
    name: Dummy Workflow
    source:
      type: local
      name: src  # Relative to what?
    path: workflow:echo_workflow

the local source manager will look for src in /foo/bar/src.

This change required a refactoring of the source managers:

  • managers now take a DeploymentConfig instance in the constructor, hence the protocol was changed into an abstract class
  • the deployment config has a new field base_path that's automatically populated when from_yaml is used.

@coveralls
Copy link

coveralls commented Feb 6, 2025

Coverage Status

coverage: 79.167% (+0.3%) from 78.854%
when pulling 7a712b6 on massi/source_manager_refact
into f625bfd on main.

Copy link
Collaborator

@logan-markewich logan-markewich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me, sensible change 👍🏻 I agree by default it should be relative to the yml

Main worry is that maybe we can auto-detect relative vs. absolute paths

@masci
Copy link
Member Author

masci commented Feb 7, 2025

Pasting here for visibility:

So to recap:

  • /path/to/sources points to the absolute location
  • path/to/sources refers to the folder containing the deployment file
  • ./path/to/sources same as above

@masci masci merged commit ab497c7 into main Feb 7, 2025
31 checks passed
@masci masci deleted the massi/source_manager_refact branch February 7, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants