Skip to content

Adds PluginSlug & PluginWpOrgDirectorySlug #91

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

Merged
merged 1 commit into from
May 21, 2024
Merged

Adds PluginSlug & PluginWpOrgDirectorySlug #91

merged 1 commit into from
May 21, 2024

Conversation

oguzkocer
Copy link
Contributor

Builds on #90.

  • The plugin slugs returned from the /plugins endpoint will be in foo/bar format, for example hello-dolly/hello & classic-editor/classic-editor
  • The plugin slugs in WordPress.org directory is in foo format: hello-dolly & classic-editor

As explained in #90, there are two different plugin slugs and if we use String type for both, they'll be easy to mix up. The PR introduces PluginSlug & PluginWpOrgDirectorySlug types to address the issue.

Note that we don't use the new type pattern for this, because new type pattern will allow passing the original type as a valid value, making it less effective. I think we might even want to make UserId to be a proper type to avoid this issue - although with UserId it's more of a heads up to developers rather than a guard against a practical issue. So, I could see an argument for using the new type pattern for those cases.


To Test

  • make test-server && make dump-mysql && make backup-wp-content-plugins
  • cargo test --test '*' -- --nocapture --test-threads 1

@oguzkocer oguzkocer added the Rust label May 20, 2024
@oguzkocer oguzkocer added this to the 0.1 milestone May 20, 2024
@oguzkocer oguzkocer requested review from crazytonyli and jkmassel May 21, 2024 14:51
@oguzkocer oguzkocer mentioned this pull request May 21, 2024
Base automatically changed from plugins to trunk May 21, 2024 22:01
@oguzkocer oguzkocer marked this pull request as ready for review May 21, 2024 22:05
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind adding some docs (similar to your PR description) to these two types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not at all, but do you mind if that happens as part of the general documentation effort that's scheduled in the next milestone-ish?

I am not sure about the format yet, so I don't want to add a random one at the moment. However, be assured that everything public will have documentation soon 😅

@oguzkocer oguzkocer enabled auto-merge (squash) May 21, 2024 23:12
@oguzkocer oguzkocer merged commit e160743 into trunk May 21, 2024
13 of 18 checks passed
@oguzkocer oguzkocer deleted the plugin-slug branch May 21, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants