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

Refactor deploy_to_develop pipeline in tech-specific pipelines #1045

Closed
3 tasks
Tracked by #1040
pombredanne opened this issue Jan 11, 2024 · 3 comments
Closed
3 tasks
Tracked by #1040

Refactor deploy_to_develop pipeline in tech-specific pipelines #1045

pombredanne opened this issue Jan 11, 2024 · 3 comments
Milestone

Comments

@pombredanne
Copy link
Member

pombredanne commented Jan 11, 2024

We want to be able to run d2d combined and separately:

  • Create d2d analyze_deployed_java pipeline
  • Create d2d analyze_deployed_javascript pipeline
  • Create d2d match_code pipeline
@pombredanne pombredanne changed the title Refactor deploy_to_develop pipeline Refactor deploy_to_develop pipeline in tech-specific pipelines Jan 11, 2024
@pombredanne pombredanne added this to the v34.0.0 milestone Jan 11, 2024
@tdruez
Copy link
Member

tdruez commented Jan 11, 2024

Here's the list of steps for the current d2d pipeline:

  • get_inputs
  • extract_inputs_to_codebase_directory
  • extract_archives_in_place
  • collect_and_create_codebase_resources
  • fingerprint_codebase_directories
  • flag_empty_files
  • flag_whitespace_files
  • flag_ignored_resources
  • map_about_files
  • map_checksum
  • match_archives_to_purldb
  • find_java_packages
  • map_java_to_class
  • map_jar_to_source
  • map_javascript
  • match_directories_to_purldb
  • match_resources_to_purldb
  • map_javascript_post_purldb_match
  • map_javascript_path
  • map_javascript_colocation
  • map_thirdparty_npm_packages
  • map_path
  • flag_mapped_resources_archives_and_ignored_directories
  • perform_house_keeping_tasks
  • match_purldb_resources_post_process
  • remove_packages_without_resources
  • scan_unmapped_to_files
  • scan_mapped_from_for_files
  • flag_deployed_from_resources_with_missing_license
  • create_local_files_packages

The Java-specific steps are:

  • find_java_packages
  • map_java_to_class
  • map_jar_to_source

The JavaScript-specific steps are:

  • map_javascript
  • map_javascript_post_purldb_match. (warning dependency on the match_to_purldb steps)
  • map_javascript_path
  • map_javascript_colocation
  • map_thirdparty_npm_packages

Now in case we want to have a tech-specific only type of d2d pipeline, how do we want to deal with the 20+ other steps that are not tech-specific? ie: extract, collect, fingerprint, flag, map about, map checksum, match purldb, cleanup, scan, etc...

If we duplicate those steps across all d2d_* pipeline, how can we run multiple of those on the same project?


An alternative idea would be to decorate/flag some steps as technology-specific, and define/enable on the project (or pipeline args) the tech to be handle in the single d2d pipeline.

class DeployToDevelop(Pipeline):
 [...]
 
 @tag("java")
 def find_java_packages(self):
     """Find the java package of the .java source files."""
     d2d.find_java_packages(self.project, logger=self.log)

 @tag("javascript", "purldb")
 def map_javascript_post_purldb_match(self):
     """Map minified javascript file based on existing PurlDB match."""
     d2d.map_javascript_post_purldb_match(project=self.project, logger=self.log)
pipeline = DeployToDevelop()
pipeline.enabled_tags = ["java", "purldb"]
pipeline.save()

Available tags/flags would be available in the UI as checkboxes:

  • Java
  • JavaScript
  • Python
  • C

Flagged steps that are not enabled will be skipped during the pipeline execution.
This implementation would not be d2d specific but used globally as a way to easily exclude steps from pipeline execution.

@pombredanne Let me know your take on this approach.

@pombredanne
Copy link
Member Author

@tdruez I like the approach. We could even refine this later to have an "automatic" feature that would guess the technologies.
We need to have it selectable fopr now though, so you approach makes sense

tdruez added a commit that referenced this issue Jan 18, 2024
Signed-off-by: tdruez <tdruez@nexb.com>
keshav-space added a commit that referenced this issue Feb 1, 2024
Temporary workaround until we have implemented #1045 (comment)

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
keshav-space added a commit that referenced this issue Feb 1, 2024
Temporary workaround until we have implemented #1045 (comment)

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
tdruez added a commit that referenced this issue Feb 2, 2024
Signed-off-by: tdruez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Feb 2, 2024
Signed-off-by: tdruez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Feb 6, 2024
Signed-off-by: tdruez <tdruez@nexb.com>
tdruez added a commit that referenced this issue Feb 6, 2024
@tdruez
Copy link
Member

tdruez commented Feb 6, 2024

Implemented in #1055

@tdruez tdruez closed this as completed Feb 6, 2024
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

No branches or pull requests

2 participants