-
Notifications
You must be signed in to change notification settings - Fork 43
feat: change storages arguments to function instance #1789
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
Open
paaragon
wants to merge
7
commits into
main
Choose a base branch
from
feat-improve-storage-logic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1defce1
feat: change storages arguments to function instance
paaragon 203f689
fix tests
paaragon 90410d3
add release notes
paaragon b0b36bc
Merge branch 'main' into feat-improve-storage-logic
paaragon a25c5e9
fix: username from request, not function
paaragon a92e1d5
Merge branch 'feat-improve-storage-logic' of github.com:Qiskit/qiskit…
paaragon c6031f7
Merge branch 'main' into feat-improve-storage-logic
korgan00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,7 +146,8 @@ def test_run(self): | |
| self.assertEqual(job.config.workers, None) | ||
| self.assertEqual(job.config.auto_scaling, True) | ||
|
|
||
| arguments_storage = ArgumentsStorage(user.username, "Program", None) | ||
| program = Program.objects.get(title="Program", author=user) | ||
| arguments_storage = ArgumentsStorage(user.username, program) | ||
| stored_arguments = arguments_storage.get(job.id) | ||
|
|
||
| self.assertEqual(stored_arguments, arguments) | ||
|
|
@@ -195,9 +196,8 @@ def test_provider_run(self): | |
| self.assertEqual(job.config.workers, None) | ||
| self.assertEqual(job.config.auto_scaling, True) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should assert if the folder name where the result/argument/logs/whatever is created is right, not only the content. |
||
| arguments_storage = ArgumentsStorage( | ||
| user.username, "Docker-Image-Program", "default" | ||
| ) | ||
| program = Program.objects.get(title="Docker-Image-Program", author=user) | ||
| arguments_storage = ArgumentsStorage(user.username, program) | ||
| stored_arguments = arguments_storage.get(job.id) | ||
|
|
||
| self.assertEqual(stored_arguments, arguments) | ||
|
|
||
9 changes: 9 additions & 0 deletions
9
releasenotes/notes/improve-storage-logic-cffa12b8e089a34d.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| upgrade: | ||
| - | | ||
| Refactored storage service initialization to accept ``Program`` model instances | ||
| instead of individual parameters. The ``FileStorage``, ``ArgumentsStorage``, and | ||
| ``ResultStorage`` classes now accept a ``function`` parameter (Program model instance) | ||
| rather than separate ``username``, ``function_title``, and ``provider_name`` parameters. | ||
| This change improves code cohesion by reducing the number of parameters passed between | ||
| components and ensures consistent access to program metadata across storage services. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this changes is putting the result data in the wrong folder. The folder should be the user who runs the job. That means, this change is not needed at all.