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/remove functionality level #649

Merged
merged 12 commits into from
Feb 21, 2024
Merged

Conversation

Grifs
Copy link
Collaborator

@Grifs Grifs commented Feb 13, 2024

Describe your changes

Remove the functionality layer from the config and move all fields to the top layer.

Related issue(s)

Closes #500

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New functionality (non-breaking change which adds functionality)
  • Major change (non-breaking change which modifies existing functionality)
  • Minor change (non-breaking change which does not modify existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Checklist

Requirements:

  • I have read the CONTRIBUTING doc.
  • I have performed a self-review of my code by checking the "Changed Files" tab.
  • My code follows the code style of this project.

Tests:

  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Documentation:

  • Proposed changes are described in the CHANGELOG.md.
  • I have updated the documentation accordingly.

Test Environment

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (9d9e5a7) 92.51% compared to head (dbb1237) 92.46%.

Files Patch % Lines
src/main/scala/io/viash/config/package.scala 93.75% 4 Missing ⚠️
src/main/scala/io/viash/ViashTest.scala 80.00% 2 Missing ⚠️
src/main/scala/io/viash/config/Config.scala 96.42% 2 Missing ⚠️
src/main/scala/io/viash/Main.scala 75.00% 1 Missing ⚠️
...c/main/scala/io/viash/runners/NextflowRunner.scala 92.85% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #649      +/-   ##
===========================================
- Coverage    92.51%   92.46%   -0.06%     
===========================================
  Files          129      127       -2     
  Lines         3889     3889              
  Branches       635      623      -12     
===========================================
- Hits          3598     3596       -2     
- Misses         291      293       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Grifs
Copy link
Collaborator Author

Grifs commented Feb 13, 2024

The built script currently still has the meta_functionality_name variable set to refer to the component's name. Should we add a second meta_component_name together with the matching VIASH_META_COMPONENT_NAME name?

In time the meta_functionality_name could be removed if/when so wanted.

Additionally, ns exec has a functionality-name identifier. Should we also duplicate this with component-name?

@rcannood
Copy link
Member

Great stuff! Before I review the PR (phew), some questions:

  • Is the change still backwards compatible for now?

  • Do we test whether this backwards compatibility still works?

  • The built script currently still has the meta_functionality_name variable set to refer to the component's name. Should we add a second meta_component_name together with the matching VIASH_META_COMPONENT_NAME name?

    Yes! Or maybe simply meta_name and VIASH_META_NAME?

  • In time the meta_functionality_name could be removed if/when so wanted.

    Yes but let's not rush this

  • Additionally, ns exec has a functionality-name identifier. Should we also duplicate this with component-name?

    Or simply name?

@Grifs
Copy link
Collaborator Author

Grifs commented Feb 14, 2024

Great stuff! Before I review the PR (phew), some questions:

  • Is the change still backwards compatible for now?

Yes, (limited) tests so far "just work". Functionality (no pun intended) is provided by https://github.com/viash-io/viash/pull/649/files#diff-08d6fbd855a302a8c8a679e2d4e5612616e059a9a14020da75697415e974c04cR223

  • Do we test whether this backwards compatibility still works?

Not yet explicitly (but I believe there is still an external script that is fetched and that is currently still in the old format). It's on my TODO list. (shouldn't take too much time 🤞 )

  • The built script currently still has the meta_functionality_name variable set to refer to the component's name. Should we add a second meta_component_name together with the matching VIASH_META_COMPONENT_NAME name?

    Yes! Or maybe simply meta_name and VIASH_META_NAME?

👍

  • In time the meta_functionality_name could be removed if/when so wanted.

    Yes but let's not rush this

👍

  • Additionally, ns exec has a functionality-name identifier. Should we also duplicate this with component-name?

    Or simply name?

👍

@Grifs Grifs force-pushed the feature/remove_functionality_level branch from 773f014 to a7b3797 Compare February 14, 2024 10:07
Tweak wording of the deprecation message as not being removed but deprecated
@Grifs Grifs requested a review from rcannood February 14, 2024 11:18
@Grifs Grifs marked this pull request as ready for review February 14, 2024 11:18
namespace = appliedConfig.config.functionality.namespace,
functionalityName = appliedConfig.config.functionality.name
namespace = appliedConfig.config.namespace,
componentName = appliedConfig.config.name
Copy link
Member

Choose a reason for hiding this comment

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

could be renamed to simply name, or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure!

@@ -56,13 +56,13 @@ object ViashNamespace extends Logging {
targetDir: String,
runnerId: String,
namespace: Option[String],
functionalityName: String
componentName: String
Copy link
Member

Choose a reason for hiding this comment

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

Same -- see above!


import io.viash.helpers.data_structures._
import io.viash.functionality.arguments.Argument
// import io.viash.helpers.data_structures._
Copy link
Member

Choose a reason for hiding this comment

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

can this be removed?

Comment on lines +231 to +234
val buildInfo = conf.apply("info")
val conf1 = buildInfo.map{ bi =>
conf.remove("info").add("build_info", bi)
}.getOrElse(conf)
Copy link
Member

Choose a reason for hiding this comment

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

Why move info to build_info? The config shouldn't contain a info field at this stage yet, right?

...Or are we using this function to read in .config.vsh.yaml files as well? 👀

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is indeed meant to have some sort of compatibility with (old) .config.vsh.yaml files. I wanted to prevent poluting & mixing .functionality.info with the build info under .info. Unlikely to happen often, but it was easy to write too.
Also, the code should be scheduled to be dropped in the future, so any extra complexity here shoud be temporary.

src/main/scala/io/viash/engines/DockerEngine.scala Outdated Show resolved Hide resolved
Comment on lines 177 to 178
("functionalityName" -> c.name),
("functionalityNamespace" -> c.namespace.getOrElse(""))
Copy link
Member

Choose a reason for hiding this comment

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

Do these keys need to be renamed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch! I was checking whether you were paying attention! >.>

src/main/scala/io/viash/schemas/CollectedSchemas.scala Outdated Show resolved Hide resolved
src/main/scala/io/viash/wrapper/BashWrapper.scala Outdated Show resolved Hide resolved
@Grifs Grifs requested a review from rcannood February 21, 2024 15:37
@Grifs Grifs merged commit 396dec0 into develop Feb 21, 2024
9 checks passed
@rcannood rcannood deleted the feature/remove_functionality_level branch April 5, 2024 06:52
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.

2 participants