Skip to content

Conversation

@janmatzek
Copy link
Contributor

No description provided.

@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch from e50c7cf to d79baa1 Compare June 23, 2025 11:32
@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch 2 times, most recently from 3d4e46e to b00dc0f Compare July 7, 2025 06:38
@janmatzek janmatzek marked this pull request as ready for review July 7, 2025 06:41
Copy link
Contributor

@hkad98 hkad98 left a comment

Choose a reason for hiding this comment

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

I added some comments; please have a look. Take them as optional.

I also noticed and cannot add a comment – .gitignore. Why do we need this .gitignore? Other directories have .gitkeep.

Comment on lines 40 to 60
id = (
permission["user_id"]
if permission["user_id"]
else permission["ug_id"]
)

if permission["user_id"]:
target_type = PermissionType.user
else:
target_type = PermissionType.user_group

permissions.append(
PermissionIncrementalLoad(
permission=permission["ws_permissions"],
workspace_id=permission["ws_id"],
id=id,
type=target_type,
is_active=str(permission["is_active"]).lower() == "true",
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposed simplification:

user_id = permission.get("user_id")
user_group_id = permission.get("user_id")

assert user_id is not None and user_group_id is not None

if user_id is not None:
    target_type = PermissionType.user
else:
    target_type = PermissionType.user_group

id = user_id or user_group_id

Consider using get for dictionaries. You can specify default value as an argument. E.g. permission.get("something", "nothing found")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, these could definitely be more readable! I updated one of the models and made a TODO. Refactoring this logic is in the task list anyway so I would do the cleanup toghether with that.

Comment on lines 62 to 64
export_path = (
self._backup_path
+ org_id
+ "/"
+ full_path[len(folder) + 1 :]
+ "/"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using f-string.


def export(self, folder, org_id) -> None:
"""Uploads the content of the folder to S3 as backup."""
storage_path = self._config.bucket + "/" + self._backup_path
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using f-string.

Comment on lines 74 to 79
export_path = (
self._backup_path
+ org_id
+ "/"
+ full_path[len(folder) + 1 :]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using f-string + is it necessary to init this within the for cycle? I cannot see how export_path changes.

version = "0.1.0"
description = ""
authors = [{ name = "GoodData", email = "support@gooddata.com" }]
license = { text = "BSD" }
Copy link
Contributor

Choose a reason for hiding this comment

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

We are still not sure about this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just got confirmation from Lenka that they (as in SPACE) are ok with keeping this one as the the goodata-productivity-tools was approved with this previously

Comment on lines 48 to 56
if isinstance(value, list):
attrs[key] = ", ".join(
str(list_item) for list_item in value
)
elif value is None:
continue
else:
attrs[key] = str(value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposed for better readability:

if value is None:
    continue

if isinstance(value, list):
    attrs[key] = ", ".join(str(list_item) for list_item in value)
else:
    attrs[key] = str(value)

@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch from 2259f90 to 7215918 Compare July 11, 2025 09:26
@hkad98
Copy link
Contributor

hkad98 commented Jul 14, 2025

I just realized one more thing. We use tbump to bump the version for packages. Please include the new package there as well.

@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch from 4a412f6 to d93e26d Compare July 15, 2025 10:06
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.96%. Comparing base (de04b17) to head (7461b8a).
Report is 32 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1074      +/-   ##
==========================================
- Coverage   83.07%   82.96%   -0.12%     
==========================================
  Files         158      158              
  Lines       10762    10828      +66     
==========================================
+ Hits         8941     8983      +42     
- Misses       1821     1845      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch from 7461b8a to de0403d Compare July 24, 2025 14:28
@janmatzek janmatzek force-pushed the jmat-services-pipelines-packages branch from de0403d to 3a45cf7 Compare July 25, 2025 12:08
@janmatzek janmatzek merged commit d030129 into gooddata:master Jul 28, 2025
9 checks passed
@janmatzek janmatzek deleted the jmat-services-pipelines-packages branch August 29, 2025 08:10
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.

3 participants