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

feat: adds bundles #161

Merged
merged 2 commits into from
Apr 11, 2024
Merged

feat: adds bundles #161

merged 2 commits into from
Apr 11, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Apr 8, 2024

Adds support for bundles.find, bundles.find_one, bundles.get, and bundle.delete.

Resolves #109

Adds support for bundles.find, bundles.find_one, bundles.get, and
bundle.delete.
Copy link

github-actions bot commented Apr 8, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
685 649 95% 80% 🟢

New Files

File Coverage Status
src/posit/connect/bundles.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
src/posit/connect/content.py 100% 🟢
src/posit/connect/permissions.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 77fd103 by action🐍

Copy link
Collaborator

@nealrichardson nealrichardson left a comment

Choose a reason for hiding this comment

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

A couple of questions but generally makes sense

from .resources import Resources, Resource


class BundleMetadata(Resource):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to be a Class? It's not a Resource properly, is it? There's nothing you can do with it. It just feels like a nested field in Bundle to me, Bundle.metadata is a dict.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm considering this a continuation of the pattern of using @property methods for fields to support compatibility between server versions.

for result in results
]

def find_one(self) -> Bundle | None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

find_one() is pretty pointless without any args or query params, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have defined find and fine_one in each of the Resources classes thus far, it seems ok to continue that pattern. I'm still up for adding fetch and fetch_one in place of find and find_one when there aren't any supported query params for the endpoint.

src/posit/connect/content.py Outdated Show resolved Hide resolved
@tdstein tdstein merged commit db1671b into main Apr 11, 2024
7 checks passed
@tdstein tdstein deleted the tdstein/109 branch April 11, 2024 16:37
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.

ContentItem.bundles
2 participants