Skip to content

Abstracts core file storage#21

Merged
olofk merged 3 commits intofusesoc:mainfrom
anlu85:17-abstract-core-file-storage-with-pluggable-backend-system
Oct 28, 2025
Merged

Abstracts core file storage#21
olofk merged 3 commits intofusesoc:mainfrom
anlu85:17-abstract-core-file-storage-with-pluggable-backend-system

Conversation

@anlu85
Copy link
Copy Markdown
Contributor

@anlu85 anlu85 commented Oct 23, 2025

Abstracts core file storage to allow pluggable backends. This change enables the use of different storage solutions for core files, such as local storage or cloud storage, by implementing a storage backend system.

Key changes include:

  • Modifies the CoreSerializer and related views to handle file uploads using Django's storage API instead of URLs.
  • Introduces a GitHubStorage class that implements the Storage interface to interact with GitHub repositories.
  • Updates tests to reflect the new storage mechanism.

Fixes #17

Migrates from direct GitHub API usage to a pluggable storage backend for handling core and signature files.
This allows for greater flexibility in storage options and simplifies the publishing process.

Removes direct dependency on GitHub API for file storage within the `init_db` management command and `Publish` API view.
It introduces a `GitHubStorage` class that implements Django's storage API, enabling local caching and easier management of file uploads.

The changes include updates to models, serializers, and templates to reflect the shift to file-based storage rather than URLs.

Fixes fusesoc#17
Moves core file storage to a pluggable backend system, allowing for different storage mechanisms (e.g., GitHub, local file system).

This change decouples the core directory from GitHub-specific storage, making the system more flexible and testable.
It also removes the direct dependency on the GitHub API within the publish and get core endpoints.

The changes include:

- Introducing a `GitHubStorage` class that inherits from Django's `Storage` class, handling file operations on GitHub.
- Modifying the `publish` and `get_core` API views to use Django's storage API instead of directly interacting with GitHub.
- Adding a management command to initialize the database from the storage backend.
- Replacing core_url with core_file in the CorePackage model and related tests.
- Adding tests for the new storage backend.

Fixes fusesoc#17
@anlu85 anlu85 force-pushed the 17-abstract-core-file-storage-with-pluggable-backend-system branch 4 times, most recently from 7f83c7c to 2bf2856 Compare October 23, 2025 20:13
@anlu85 anlu85 force-pushed the 17-abstract-core-file-storage-with-pluggable-backend-system branch from 2bf2856 to 711894a Compare October 23, 2025 20:17
@olofk
Copy link
Copy Markdown
Contributor

olofk commented Oct 28, 2025

Looks perfectly fine to me. Thanks.

@olofk olofk merged commit 7312937 into fusesoc:main Oct 28, 2025
5 checks passed
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.

Abstract Core File Storage with Pluggable Backend System

2 participants