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

Issue #13494: Redirects checks 404 error page from index.html to https://checkstyle.org/checks.html #14667

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MANISH-K-07
Copy link
Contributor

Part of #13494

I have added an index.html file that is theoretically supposed to redirect to a custom set url.
The redirecting url has been set to https://checkstyle.org/checks.html from root.

The file added is very basic boiler plate with just a title and redirection link. If this works, we can add viewport, canonical link (for SEO), and anything else if required.

@MANISH-K-07 MANISH-K-07 changed the title Issue #13494: Redirects checks 404 error page to index.html Issue #13494: Redirects checks 404 error page from index.html to https://checkstyle.org/checks.html Mar 16, 2024
Copy link
Member

@rnveach rnveach left a comment

Choose a reason for hiding this comment

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

If this works

You need to test it on your local and confirm it works. We shouldn't be merging something which is untested.

<head>
<meta charset="UTF-8" />
<title>Redirecting...</title>
<meta http-equiv="refresh" content="0; URL=https://checkstyle.org/checks.html" />
Copy link
Member

Choose a reason for hiding this comment

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

=> <meta http-equiv="refresh" content="0; URL=../checks.html" />

This has to work from our versioned documentation.
See https://checkstyle.org/#Previous_Version_Documentation

@rnveach rnveach self-assigned this Mar 16, 2024
@MANISH-K-07
Copy link
Contributor Author

MANISH-K-07 commented Mar 16, 2024

You need to test it on your local and confirm it works.

@rnveach , thanks a lot for the reply.
I am not entirely sure how I can generate website from local. Could you please point me to some source that I can refer to ?
I tried our wiki pages, did I miss a page related to this ?

@rnveach
Copy link
Member

rnveach commented Mar 16, 2024

https://github.com/checkstyle/checkstyle/wiki/How-to-run-certain-phases-and-validations#how-to-generate-website-only

@romani
Copy link
Member

romani commented Mar 17, 2024

Share a video of redirection in Chrome, Firefox.

@romani
Copy link
Member

romani commented Mar 17, 2024

GitHub, generate website

@romani
Copy link
Member

romani commented Mar 17, 2024

We should have website from GitHub bot

@romani romani marked this pull request as ready for review March 17, 2024 02:56
@MANISH-K-07

This comment was marked as outdated.

@MANISH-K-07

This comment was marked as outdated.

@MANISH-K-07
Copy link
Contributor Author

@rnveach , @romani ,
The index file seems just fine and also the url has no issues.

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>K3NWAR422HTA16F0</RequestId>
<HostId>B/XnoRlbQzYpwQlLdPsnLz16XvXQFlapTAB2MQ9waa/vPstra+lSe2bionUcqX/YrE3EHZrClNk=</HostId>
</Error>

Could this error be from the other end and not from my side ?

@romani
Copy link
Member

romani commented Mar 19, 2024

generate website on local and share sources of it your github.io to let us see that index.html is generated in required path.

@MANISH-K-07

This comment was marked as outdated.

@rnveach
Copy link
Member

rnveach commented Mar 19, 2024

https://github.com/MANISH-K-07/MANISH-K-07.github.io

Your github.io has only 1 file in it. It needs to have all the files generated by the site command.

@MANISH-K-07
Copy link
Contributor Author

https://github.com/MANISH-K-07/MANISH-K-07.github.io

Your github.io has only 1 file in it. It needs to have all the files generated by the site command.

Got it ! Thanks for your help @rnveach , I have pushed generated files. Please check https://manish-k-07.github.io/

However, https://manish-k-07.github.io/checks/ is giving 404 instead of "Access denied" like in branch ?

@rnveach
Copy link
Member

rnveach commented Mar 19, 2024

However, https://manish-k-07.github.io/checks/ is giving 404 instead of "Access denied" like in branch

https://github.com/MANISH-K-07/MANISH-K-07.github.io/tree/main/checks
There is no index file here.

@MANISH-K-07
Copy link
Contributor Author

MANISH-K-07 commented Mar 20, 2024

https://github.com/MANISH-K-07/MANISH-K-07.github.io/tree/main/checks There is no index file here.

The redirection plate I added works.
For testing, I manually inserted the file in my github.io and then the page is getting redirected as expected.
Please see https://manish-k-07.github.io/checks/ redirects to https://checkstyle.org/checks

@rnveach , I will try to figure out why we are missing index while generating site. But as a completely different thought, could we simply insert this file at https://github.com/checkstyle/checkstyle.github.io/tree/master/checks or will it get overridden during every release by gh bot ?

I'm not sure yet why index isn't getting generated. Any possible ideas ?

@rnveach
Copy link
Member

rnveach commented Mar 20, 2024

Please see https://manish-k-07.github.io/checks/ redirects to https://checkstyle.org/checks

Which is shouldn't as my review indicated above just to be clear.

I'm not sure yet why index isn't getting generated.

My current thought right now is it is missing because it is not a doxia file. All other files are VM or XML files in the directory. I think you might need to research doxia and figure out how to play nice and integrate with it.

But as a completely different thought, could we simply insert this file at https://github.com/checkstyle/checkstyle.github.io/tree/master/checks or will it get overridden during every release by gh bot ?

As for manually injecting into the github.io , I believe you are correct it will go missing. I am sure we erase and copy over new files each release. All our release scripts are in GH too. I currently do not feel we should make an override for just this one purpose yet, not while doxia is not investigated.
https://github.com/checkstyle/checkstyle/blob/master/.ci/release-update-github-io.sh#L18

I am going to mark this PR until it is investigated more.

@MANISH-K-07
Copy link
Contributor Author

MANISH-K-07 commented Mar 20, 2024

@rnveach , Sure I will try to dive into doxia.
A small clarification please ,

Which is shouldn't as my review indicated above just to be clear.

I don't understand this part. The primary goal of this issue as you have mentioned in #13494 (comment) was to redirect https://checkstyle.org/checks/ to https://checkstyle.org/checks.html. Isn't a similar thing happening with my github.io repo?

From #14667 (comment), for previous version docs, we are using sourceforge pages and not gh pages. So, isn't this a different issue as mentioned by @romani in #13494 (comment) ?
Yes, https://checkstyle.sourceforge.io/version/6.18/checks/ also gives an error page, but I believe it will need a different approach than this (smtg like .htaccess file)

Please correct me if I'm missing something here. I'm unable to properly understand your goal here

@rnveach
Copy link
Member

rnveach commented Mar 20, 2024

Which is shouldn't as my review indicated above just to be clear.
I don't understand this part.

#14667 (comment)
What part do you not understand of my review? With the change I suggested, we will not be forced to an absolute URL and it will be a relative URL instead.

we are using sourceforge pages and not gh pages

This doesn't matter, unless it concerns implementation. This PR is an HTML page, so I expect HTML to work wherever it is since its the browser that executes HTML. As of right now, we have not seen it working, so this is why this PR is blocked.

smtg like .htaccess file

This is implementation. There is no htaccess in this PR, so I can't comment more on this and this would be a discussion in the issue, especially if you are asking how to proceed.

However, I am fine with older versioned documentation pages not working and have this just be resolved for future versions after this issue is resolved. If it is serious enough, we could probably just copy the file needed to make this work to the specific versions.

@MANISH-K-07
Copy link
Contributor Author

MANISH-K-07 commented Mar 20, 2024

=> <meta http-equiv="refresh" content="0; URL=../checks.html" />

This has to work from our versioned documentation. See https://checkstyle.org/#Previous_Version_Documentation

Got it now !!
I assumed you were asking for this same redirection to work from previous versioned docs too

With the change I suggested, we will not be forced to an absolute URL and it will be a relative URL instead.

Yes, this I figured out :)

the browser that executes HTML. As of right now, we have not seen it working,

seems html here works for redirection. Problem here is that we are missing this file on site generation which I will look into

However, I am fine with older versioned documentation pages not working and have this just be resolved

Doxia is new to me.. might need some time to come up with a fix. I will get back on this PR soon

@rnveach rnveach removed their assignment Mar 29, 2024
@romani
Copy link
Member

romani commented May 11, 2024

GitHub, generate website

@romani
Copy link
Member

romani commented May 12, 2024

Html file is still not generating properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants