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

Artifact Fetching Module #118

Merged
merged 34 commits into from
Sep 13, 2024
Merged

Artifact Fetching Module #118

merged 34 commits into from
Sep 13, 2024

Conversation

schuylermartin45
Copy link
Collaborator

@schuylermartin45 schuylermartin45 commented Sep 12, 2024

Introduces the fetcher/ module to CRM. This module is capable of downloading and extracting build artifacts to a secure temporary directory. This will be coupled with a new scanner module for future automation efforts.

Other changes:

  • Adds pyfakefs as a test dependency (used for mocking file systems)
  • Adds a series of MockHttp* classes to mock-out responses from requests
  • Starts work on a git-based fetcher
  • Starts work on a from_recipe factory method that will construct fetcher instances from a recipe's /source section.

@schuylermartin45
Copy link
Collaborator Author

@ForgottenProgramme Tagging you for visibility. Let's work together on deprecating the MockWriter class in favor of using pyfakefs

@schuylermartin45
Copy link
Collaborator Author

This will remain in draft-mode until I finish adding unit test coverage for http_artifact_fetcher.py

@schuylermartin45 schuylermartin45 marked this pull request as ready for review September 13, 2024 18:07
@schuylermartin45 schuylermartin45 requested a review from a team as a code owner September 13, 2024 18:07
@schuylermartin45 schuylermartin45 enabled auto-merge (squash) September 13, 2024 18:34
@schuylermartin45 schuylermartin45 merged commit aa15b12 into main Sep 13, 2024
12 checks passed
@schuylermartin45 schuylermartin45 deleted the smartin_artifact_fetcher branch September 13, 2024 18:37
ForgottenProgramme pushed a commit that referenced this pull request Sep 16, 2024
* Initial outline for the first fetching module

* Breaks initial outline up into several sub-classes to better manage the differences in artifact type

* Adds some in-progress documentation

* Flushes out fetch exceptions

* Sures-up documentation in the artifact base class

* Finishes templat for git Artifact Fetcher

* Starts work, in-earnest, on the HTTP artifact fetcher

* First-pass implementation of the _extract() function

* Implements get_archive_sha256()

* Adds documentation

* Fetcher exceptions are now under a dedicated exception module

* Fixes current linting errors

* Fixes static analyzer issues

* The RecipeReader.get() call in from_recipe() now uses sub_vars to resolve JINJA variables

* README changes

* Fixes an issue with deriving archive names from URLs

* Fixes more extraction naming issues

* Introduces hash utility library to standardize hashing usage. Removes existing hash buffering work.

* Adds unit tests for new hashing utility module

* Remove unnessecary uses of pass. This gives a much more accurate test-coverage statistic for abstract classes

* Starts work on artifact fetching unit tests

* Adds advanced HTTP mockers

* Adds unit test for fetch() that mocks the file system and HTTP requests

* Adds missing pyfakefs requirement to the recipe file

* Fixing build test by including conda-forge

* Adds fetch failure unit tests

* Refactors test_fetch() to use test params instead of fixture params for more dynamic expected value checking

* Adds test_get_path_to_source_code() to test the happy-path of that function

* Adds unit test for get_archive_sha256()

* Adds unit test for get_archive_type()

* Update conda_recipe_manager/fetcher/base_artifact_fetcher.py

Co-authored-by: Bianca Henderson <[email protected]>

---------

Co-authored-by: Bianca Henderson <[email protected]>
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