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

Grab bag refactor #5

Merged
merged 13 commits into from
Jun 5, 2024
Merged

Grab bag refactor #5

merged 13 commits into from
Jun 5, 2024

Conversation

jssblck
Copy link
Member

@jssblck jssblck commented May 15, 2024

Overview

Adds some stuff that would have been helpful to have when working on Sherlock, and I'm running into with Sparkle again.

  • Refactors to more fully separate the different types of locator.
  • Isolates tests per locator type.
  • Adds StrictLocator, which requires the revision component.
  • Adds Ord, PartialOrd, and JSONSchema implementations to all public types.
  • Adds special types for the components of a locator (Package, Revision, OrgId).
    • This is what forced a breaking change.
  • Renames the project field to package field to reduce confusion between the term "project" and "package" (as in, "PackageLocator").

Acceptance criteria

We can:

  • Require locators to have a revision.
  • Order locators without manually converting them to strings.
  • Inspect the schema for locators.

Testing plan

Automated tests.

Risks

Not risky.

References

Part of the Sparkle work.

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).

@jssblck jssblck requested a review from spatten May 15, 2024 22:15
Copy link

@spatten spatten left a comment

Choose a reason for hiding this comment

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

I have questions about the ordering function, so let's chat about those and then I can re-review and approve

src/locator.rs Outdated Show resolved Hide resolved
src/locator.rs Outdated Show resolved Hide resolved
src/locator.rs Show resolved Hide resolved
src/locator.rs Outdated Show resolved Hide resolved
src/locator_strict.rs Show resolved Hide resolved
src/locator.rs Outdated Show resolved Hide resolved
@jssblck jssblck requested a review from spatten May 18, 2024 01:00
Copy link

@spatten spatten left a comment

Choose a reason for hiding this comment

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

Nice! I like the change to implement Ord for the individual parts of the Locator, and the name change to Package.

@jssblck jssblck merged commit f0d2a57 into main Jun 5, 2024
10 checks passed
@jssblck jssblck deleted the impl-additions branch June 5, 2024 22:27
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