Skip to content

Conversation

@paaragon
Copy link
Contributor

@paaragon paaragon commented Dec 2, 2025

Summary

This PR refactors the storages arguments so instead of receiving title and provider, they receive a function instance.

Details and comments

@paaragon paaragon requested a review from a team as a code owner December 2, 2025 16:12
@paaragon paaragon requested a review from Tansito December 2, 2025 16:14
@paaragon paaragon marked this pull request as draft December 2, 2025 16:16
@paaragon paaragon marked this pull request as ready for review December 3, 2025 10:24
@paaragon paaragon requested a review from ElePT December 3, 2025 10:25
@paaragon paaragon self-assigned this Dec 3, 2025
Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

Same comment as I left on another PR: As a side note, I think that it would be good to also start documenting more internal-facing changes in the release notes, as we started doing with interface changes. I left some pointers in another PR on how to do this: #1788 (comment). If you don't agree, I am open for discussion on what should and shouldn't be part of the renos.

@paaragon
Copy link
Contributor Author

paaragon commented Dec 3, 2025

Same comment as I left on another PR: As a side note, I think that it would be good to also start documenting more internal-facing changes in the release notes, as we started doing with interface changes. I left some pointers in another PR on how to do this: #1788 (comment). If you don't agree, I am open for discussion on what should and shouldn't be part of the renos.

Thanks @ElePT . Change is done

@paaragon paaragon requested a review from ElePT December 3, 2025 10:59
Copy link
Contributor

@korgan00 korgan00 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just a minor thing.

@paaragon paaragon requested review from Tansito and korgan00 December 4, 2025 11:33
Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

The release note looks very good, thanks @paaragon. I have not had time to go through the rest of the PR, but I see that you already have a good amount of reviews.

Copy link
Contributor

@korgan00 korgan00 left a comment

Choose a reason for hiding this comment

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

Could you add a test trying to access Arguments storage with multiple users and have different contents in the files? The function creator with some arguments, one user with other arguments and a third one without a file. The three using the same function.
I think it should test #1789 (comment).

@avilches avilches assigned avilches and unassigned paaragon Jan 6, 2026
@avilches
Copy link
Contributor

avilches commented Jan 6, 2026

I've rolled back the changes in the ResultStorage.
Added some tests to assert the folder generated is valid.

Copy link
Contributor

@avilches avilches left a comment

Choose a reason for hiding this comment

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

In theory, others users could access to jobs from other users: https://github.com/Qiskit/qiskit-serverless/blob/main/gateway/api/access_policies/jobs.py

But only the owner can save and read the results:

def can_read_result(user, job) -> bool:
    return has_access = user.id == job.author.id

def can_save_result(user, job) -> bool:
    return has_access = user.id == job.author.id

So, use user.username is in save_result and retrieve results is ok, so now it works. But if change the access in the future, it will fails. With these changes, we can be safe.

@avilches avilches requested review from ElePT and korgan00 January 6, 2026 17:28
@Tansito
Copy link
Member

Tansito commented Jan 7, 2026

@avilches I'm not feeling very well today to follow all the comments here sorry, I will try to look at this tomorrow if I feel better 🙏

@avilches
Copy link
Contributor

avilches commented Jan 7, 2026

@avilches I'm not feeling very well today to follow all the comments here sorry, I will try to look at this tomorrow if I feel better 🙏

Too much text? TLDR = this PR includes the fix for two hidden bugs.

Take care!

@avilches avilches merged commit fa7f158 into main Jan 9, 2026
13 checks passed
@avilches avilches deleted the feat-improve-storage-logic branch January 9, 2026 15:38
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.

5 participants