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

Feature/entities/resolve conflict #1023

Merged

Conversation

sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Oct 11, 2023

Part of getodk/central#506

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

Test

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

Adding a separate function to resolve the conflict felt clean thing to do; instead of modifying existing update function

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?

None.

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

Done

Before submitting this PR, please make sure you have:

  • run make test-full 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

@sadiqkhoja sadiqkhoja force-pushed the feature/entities/resolve-conflict branch from 81cb1b4 to b704533 Compare October 12, 2023 01:03
@sadiqkhoja sadiqkhoja marked this pull request as ready for review October 12, 2023 16:02
@sadiqkhoja sadiqkhoja requested a review from ktuite October 12, 2023 16:02
.then(({ body: person }) => {
should(person.conflict).be.null();
});
}));
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test checking that the right person/actor is associated with the resolve conflict audit event?

docs/api.yaml Show resolved Hide resolved
lib/model/query/entities.js Show resolved Hide resolved
@sadiqkhoja sadiqkhoja force-pushed the feature/entities/resolve-conflict branch from 12b2479 to 2004926 Compare October 13, 2023 19:17
Copy link
Member

@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.

Thanks for adding the doc changes and the audit action tests.

One of the additions to a test made me curious about calling 'resolve' on an entity without any conflict. It seems like it shouldn't resolve a conflict that doesn't exist. Mainly it shouldn't log it in the audit log, because that might be confusing later.

docs/api.yaml Outdated
@@ -36,7 +36,19 @@ info:

Here major and breaking changes to the API are listed by version.

## ODK Central v2023.4
### ODK Central v2023.5
Copy link
Member

Choose a reason for hiding this comment

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

Should this just be ##? Can you put backticks around the appropriate words below?


await exhaust(container);

await asAlice.patch('/v1/projects/1/datasets/people/entities/12345678-1234-4123-8234-123456789abc?resolve=true')
Copy link
Member

Choose a reason for hiding this comment

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

Is this suggesting that you can resolve a conflict even if there is no conflict? It seems like it shouldn't log anything if you try to resolve a conflict that doesn't exist.

@sadiqkhoja sadiqkhoja mentioned this pull request Oct 16, 2023
2 tasks
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.

2 participants