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: always resolve content owner #224

Merged
merged 4 commits into from
Jun 13, 2024
Merged

feat: always resolve content owner #224

merged 4 commits into from
Jun 13, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Jun 12, 2024

Resolves #165

Copy link

github-actions bot commented Jun 12, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1021 985 96% 0% 🟢

New Files

No new covered files...

Modified Files

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

updated for commit: b6b358f by action🐍

@@ -37,7 +37,13 @@
"default_py_environment_management": null,
"run_as": null,
"run_as_current_user": false,
"owner_guid": "87c12c08-11cd-4de1-8da3-12a7579c4998",
"owner_guid": "20a79ce3-6e87-4522-9faf-be24228800a4",
"owner": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would back this change out. The API wouldn't return owner in this request.

src/posit/connect/content.py Outdated Show resolved Hide resolved
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.

One last suggestion on the test but otherwise LGTM!

c = Client("12345", "https://connect.example")
item = c.content.get("f2f37341-e21d-3d80-c698-a935ad614066")
owner = item.owner
assert owner.guid == "20a79ce3-6e87-4522-9faf-be24228800a4"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Other things to assert:

  • owner is ContentItemOwner (if we care about that)
  • The user GET on L201 was called once
  • Do item.owner again and confirm that L201 has still only been called once.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. Done. Thanks!

@tdstein tdstein merged commit 22e38c7 into main Jun 13, 2024
30 checks passed
@tdstein tdstein deleted the tdstein/165 branch June 13, 2024 14:11
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.owner
2 participants