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

Rename the wp-env schema to not be a dotfile #62634

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

ajlende
Copy link
Contributor

@ajlende ajlende commented Jun 17, 2024

What?

Rename the wp-env schema to not be a dotfile.

Why?

Schemastore.org also stores schemas for dotifles without the dot, and we're mostly mirroring how they handle schemas.

How?

Rename the wp-env schema to not be a dotfile.

Testing Instructions

Can't properly be tested until merged, but schema urls will have to be updated to https://schemas.wp.org/trunk/wp-env.json.

Testing Instructions for Keyboard

Screenshots or screencast

@ajlende ajlende added [Type] Bug An existing feature does not function as intended [Tool] Env /packages/env labels Jun 17, 2024
@ajlende ajlende requested review from sirreal and t-hamano June 17, 2024 17:19
@ajlende ajlende self-assigned this Jun 17, 2024
Copy link

github-actions bot commented Jun 17, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Co-authored-by: dd32 <dd32@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

I tested how the theme.json and block.json schemas are redirected.

$ curl -s -o /dev/null -w "%{redirect_url}\n" https://schemas.wp.org/trunk/block.json
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/block.json
$ curl -s -o /dev/null -w "%{redirect_url}\n" https://schemas.wp.org/trunk/theme.json
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json

Regarding the wp-env scheme, it seems like the redirect URL is not correct, whether there is a dot or not.

$ curl -s -o /dev/null -w "%{redirect_url}\n" https://schemas.wp.org/trunk/.wp-env.json
https://raw.githubusercontent.com/
$ curl -s -o /dev/null -w "%{redirect_url}\n" https://schemas.wp.org/trunk/wp-env.json
https://raw.githubusercontent.com/

Will this issue be resolved if this PR is merged?

@ajlende ajlende added [Type] Code Quality Issues or PRs that relate to code quality and removed [Type] Bug An existing feature does not function as intended labels Jun 17, 2024
@ajlende
Copy link
Contributor Author

ajlende commented Jun 17, 2024

Will this issue be resolved if this PR is merged?

Judging from the tests you did, it doesn't look like it. And after some more searching, I found a systems request Add redirect for Font Collection JSON schema which worked and I assumed didn't need the systems change.

I asked in #meta on the Making WordPress slack if it could get added.

I still think we should keep the rename, so I've updated the description to reflect that.

Once I figure out the process, I'll update the README.md with details for future developers adding schemas.

@t-hamano
Copy link
Contributor

I checked the "Schema redirect for .wp-env.json" post. From what I saw in the post, it seems that the redirection is done for the dotted file.

https://schemas.wp.org/trunk/.wp-env.json
=>
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/.wp-env.json

Therefore, I am concerned that if we push ahead with this PR, the redirected file will not be found.

If we go ahead with this PR and take Schemastore.org into consideration, should we change the redirect to the following:

https://schemas.wp.org/trunk/wp-env.json
=>
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/wp-env.json

@dd32
Copy link
Member

dd32 commented Jun 18, 2024

Therefore, I am concerned that if we push ahead with this PR, the redirected file will not be found.

100% move forward with this, I'll update the systems request to match.

@sirreal sirreal merged commit 33854e1 into trunk Jun 18, 2024
71 checks passed
@sirreal sirreal deleted the fix/schema-wp-env-redirect branch June 18, 2024 07:06
@github-actions github-actions bot added this to the Gutenberg 18.7 milestone Jun 18, 2024
@ajlende ajlende added Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta and removed Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) labels Jun 18, 2024
ellatrix pushed a commit that referenced this pull request Jun 25, 2024
Rename the wp-env schema to not be a dotfile.

Dotfiles have special handling in many systems, including schemastore.org.
Remove the leading dot to improve compatibility.

---

Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Co-authored-by: dd32 <dd32@git.wordpress.org>
@ellatrix
Copy link
Member

I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 861b089

@ellatrix ellatrix added Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Jun 25, 2024
ellatrix pushed a commit that referenced this pull request Jun 25, 2024
Rename the wp-env schema to not be a dotfile.

Dotfiles have special handling in many systems, including schemastore.org.
Remove the leading dot to improve compatibility.

---

Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: sirreal <jonsurrell@git.wordpress.org>
Co-authored-by: dd32 <dd32@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported to WP Core Pull request that has been successfully merged into WP Core [Tool] Env /packages/env [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants