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

HA-423 - Fix Compass returning error for deleted GVL systems #5786

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
### Fixed
- Fixed GPP string and section inconsistencies [#5765](https://github.com/ethyca/fides/pull/5765)
- Fixed sending of notifications for privacy request receipts [#5777](https://github.com/ethyca/fides/pull/5777)
- Fixed Compass returning error for deleted GVL systems [#5786](https://github.com/ethyca/fides/pull/5786)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this isn't a very accurate description IMO, it's not compass that has any sort of error here


## [2.55.0](https://github.com/ethyca/fides/compare/2.54.0...2.55.0)

Expand Down
3 changes: 2 additions & 1 deletion src/fides/api/db/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
log.debug("Creating resource")
query = _insert(sql_model.__table__).values(resource_dict)
await async_session.execute(query)
except SQLAlchemyError:
except SQLAlchemyError as err:
log.info(f"SQLAlchemyError: {err}")

Check warning on line 62 in src/fides/api/db/crud.py

View check run for this annotation

Codecov / codecov/patch

src/fides/api/db/crud.py#L61-L62

Added lines #L61 - L62 were not covered by tests
sa_error = errors.QueryError()
log.bind(error=sa_error.detail["error"]).info( # type: ignore[index]
"Failed to create resource"
Expand Down
4 changes: 1 addition & 3 deletions src/fides/api/db/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,7 @@ async def create_system(

# create the system resource using generic creation
# the system must be created before the privacy declarations so that it can be referenced
resource_dict = resource.model_dump(
mode="json"
) # mode=json helps Url fields be converted to strings before saving to db
resource_dict = resource.model_dump()
Copy link
Contributor

Choose a reason for hiding this comment

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

so did we validate that a resource here (i.e., a System) with an AnyUrl field that's populated actually gets created successfully? just trying to make sense of the comment that was clearly left here.

i'm also seeing that update_system in this module does a similar operation -

    existing_system_dict = copy.deepcopy(
        SystemSchema.model_validate(system)
    ).model_dump(mode="json")

is that not going to cause a similar problem? do we need to adjust that?


# set the current user's ID
resource_dict["user_id"] = current_user_id
Expand Down