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

Prevent Forms from introducing dataset name case conflicts #1127

Merged
merged 4 commits into from
Apr 20, 2024

Conversation

ktuite
Copy link
Member

@ktuite ktuite commented Apr 19, 2024

Closes getodk/central#627

Prevents Forms and Dataset API from introducing published datasets with conflicting names, specifically the same name with different capitalization.

  • Error on Form Upload if dataset name conflicts with a published dataset
  • Error on Form Publish if publishing will introduce a conflict, which can happen if there were multiple draft forms with different name variations, one was published, and then a second is attempted to be published.
  • Error on "New Entity List" / API if dataset name conflicts with a published dataset
    • Now allowed to create/publish a dataset that directly collides with an unpublished dataset

What has been done to verify that this works as intended?

Tests, trying with frontend.

Why is this the best possible solution? Were any other approaches considered?

I basically added another database query for a similarly named dataset. In the same area of code, we're also querying for an existing exactly matching dataset so we can reuse its ID and Actee ID for various things. I wasn't comfortable trying to combine these queries at this time, given the complicated logic of draft datasets, similar but not exact matches, multiple similar draft datasets, etc.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.

This could potentially be added to the API docs. (#1096)

Before submitting this PR, please make sure you have:

  • run make test and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code from external sources are properly credited in comments or that everything is internally sourced

@ktuite ktuite force-pushed the ktuite/dataset_names branch from 3cad3d7 to 388999e Compare April 19, 2024 20:13
@ktuite ktuite marked this pull request as ready for review April 19, 2024 20:23
@ktuite ktuite requested a review from matthew-white April 19, 2024 20:24
Copy link
Member Author

@ktuite ktuite left a comment

Choose a reason for hiding this comment

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

Interactive review with @matthew-white

@ktuite ktuite merged commit 60ac8ca into master Apr 20, 2024
5 checks passed
@ktuite ktuite deleted the ktuite/dataset_names branch April 20, 2024 00:00
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.

Names of datasets are case-sensitive
2 participants