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

Fix README section links on DockerHub #915

Merged
merged 3 commits into from
Mar 14, 2025

Conversation

JackPGreen
Copy link
Collaborator

@JackPGreen JackPGreen commented Mar 11, 2025

On the DockerHub page, links such as Check Hazelcast Enterprise Versions for the version do not work - because there are no corresponding anchors. Added manually.

On the [DockerHub page](https://hub.docker.com/r/hazelcast/hazelcast), links such as `Check Hazelcast Enterprise Versions for the version` do not work - because they are relative to the document.

As _a_ link did work by having a hardcoded link back to the github/hazelcast-docker `README`, I've updated the rest to suit.

Note that this could _also_ have been addressed by reconfiguring the `dockerhub-description` action, [with caveats](https://github.com/peter-evans/dockerhub-description?tab=readme-ov-file#url-completion-known-issues).
@JackPGreen JackPGreen self-assigned this Mar 11, 2025
@JackPGreen JackPGreen requested a review from a team as a code owner March 11, 2025 14:56
@JackPGreen JackPGreen enabled auto-merge (squash) March 11, 2025 15:05
@nishaatr
Copy link
Contributor

Note that this could also have been addressed by reconfiguring the dockerhub-description action, with caveats.

Sorry which point is the caveat?

@JackPGreen
Copy link
Collaborator Author

Note that this could also have been addressed by reconfiguring the dockerhub-description action, with caveats.

Sorry which point is the caveat?

You can use the URL Completion option instead, but it has "known issues".

@nishaatr
Copy link
Contributor

Note that this could also have been addressed by reconfiguring the dockerhub-description action, with caveats.

Sorry which point is the caveat?

You can use the URL Completion option instead, but it has "known issues".

I presume you mean point 1 in with caveats
And this seems to have the desired effect as link is converted to https://hub.docker.com/r/hazelcast/hazelcast#hazelcast-versions
Looks like the issue is that we are missing HTML anchor for section Latest Versions which we can add here?

@JackPGreen
Copy link
Collaborator Author

I presume you mean point 1 in with caveats And this seems to have the desired effect as link is converted to https://hub.docker.com/r/hazelcast/hazelcast#hazelcast-versions

The link should go to the GitHub repo, not Dockerhub - as dockerhub doesn't have those references. Hence the link doesn't work.

Looks like the issue is that we are missing HTML anchor for section Latest Versions which we can add here?

Not sure I understand?

@nishaatr
Copy link
Contributor

nishaatr commented Mar 12, 2025

I presume you mean point 1 in with caveats And this seems to have the desired effect as link is converted to https://hub.docker.com/r/hazelcast/hazelcast#hazelcast-versions

The link should go to the GitHub repo, not Dockerhub - as dockerhub doesn't have those references. Hence the link doesn't work.

Looks like the issue is that we are missing HTML anchor for section Latest Versions which we can add here?

Not sure I understand?

Best we step back a bit:

  1. the Docker link Hazelcast Versions points to 'Latest Versions' in the same page (which doesn't work). End of the section says You can find the full list of Hazelcast versions at the [Official Hazelcast Docker Hub⁠](https://store.docker.com/community/images/hazelcast/hazelcast/tags....)
  2. In GH, it says You can find the full list of Hazelcast versions at the [Official Hazelcast Docker Hub](https://store.docker.com/community/images/hazelcast/hazelcast/tags).

So at the end both are pointing https://store.docker.com/community/images/hazelcast/hazelcast/tags but 'Latest Versions' has some versions listed locally. If we point users to GH then they have to click again to DH. So may be should rationalize this

Option 1: make GH and DH both point to https://store.docker.com/community/images/hazelcast/hazelcast/tags and remove the list in Latest Versions. In fact, we don't even need section Hazelcast Versions and simply point to tags in Check [Hazelcast Versions](https://hub.docker.com/r/hazelcast/hazelcast#hazelcast-versions)

Option 2: just add HTML anchor in https://github.com/hazelcast/hazelcast-docker/blob/master/.github/scripts/generate-docker-hub-description.sh#L39

   sed -i -e "/$matching_line/ {
        a\

        a\
       <a name="hazelcast-versions"></a>
        #### Latest Versions

OR 
        #### <a name="hazelcast-versions"></a>Latest Versions
        a\
        r $tags_file
    }" "$filename"

I think Option 2 will work. I added the anchor in browser (Dev tools) and then the link works as is

Hope this makes sense!

UPDATE:

Forgot that we have also other links

UPDATE

May be its easier to add <a> in README.md file for all the broken links so generate-docker-hub-description.sh doesn't need updating. Just a though

@JackPGreen
Copy link
Collaborator Author

Option 2: just add HTML anchor in https://github.com/hazelcast/hazelcast-docker/blob/master/.github/scripts/generate-docker-hub-description.sh#L39

   sed -i -e "/$matching_line/ {
        a\

        a\
       <a name="hazelcast-versions"></a>
        #### Latest Versions

OR 
        #### <a name="hazelcast-versions"></a>Latest Versions
        a\
        r $tags_file
    }" "$filename"

I think Option 2 will work. I added the anchor in browser (Dev tools) and then the link works as is

Hope this makes sense!

Does this work via the docker action? I'd be surprised if you could add (arbitrary) HTML for security reasons.

May be its easier to add <a> in README.md file for all the broken links so generate-docker-hub-description.sh doesn't need updating. Just a though

Then it wouldn't work in GitHub?

@nishaatr
Copy link
Contributor

Does this work via the docker action? I'd be surprised if you could add (arbitrary) HTML for security reasons.

I think so. The script first takes everything from README.md and then fill the versions
Adding HTML to markdown is allowed

Then it wouldn't work in GitHub?

Looks like its supported https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors

I think worth trying!

@JackPGreen
Copy link
Collaborator Author

Does this work via the docker action? I'd be surprised if you could add (arbitrary) HTML for security reasons.

I think so. The script first takes everything from README.md and then fill the versions Adding HTML to markdown is allowed

I was thinking more on the Dockerhub side

Then it wouldn't work in GitHub?

Looks like its supported https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors

I think worth trying!

My problem is that I can't test ^ that ^ without pushing to Dockerhub. But I can know my way works...

@nishaatr
Copy link
Contributor

nishaatr commented Mar 12, 2025

Does this work via the docker action? I'd be surprised if you could add (arbitrary) HTML for security reasons.

I think so. The script first takes everything from README.md and then fill the versions Adding HTML to markdown is allowed

I was thinking more on the Dockerhub side

Then it wouldn't work in GitHub?

Looks like its supported https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#custom-anchors
I think worth trying!

My problem is that I can't test ^ that ^ without pushing to Dockerhub. But I can know my way works...

Good point and was thinking about this.
I see you can edit the markdown directly in DH

  1. go to https://hub.docker.com/r/hazelcast/hazelcast and click Manage Repository
  2. image
  3. Go to the end of page and click Edit
  4. image

I have added <a name="hazelcast-versions"></a> and it works. Check!

Use devopshazelcast user

We make the change but no need to publish I thing. We know works in DH and as long as it works GH then should be ok

@JackPGreen
Copy link
Collaborator Author

I have added <a name="hazelcast-versions"></a> and it works. Check!

Ok - do you want to raise a new PR for those change(s)? Or update this one instead, please?

@nishaatr
Copy link
Contributor

We should backport?

I think if we backport to 5.3.8 and retag it will trigger and we test that way.

@nishaatr
Copy link
Contributor

I have added <a name="hazelcast-versions"></a> and it works. Check!

Ok - do you want to raise a new PR for those change(s)? Or update this one instead, please?

No worries. Best here. I will get it done soon.

@JackPGreen
Copy link
Collaborator Author

We should backport?

I wasn't planning on - no-one's raised it externally, and eventually it'll trickle out.

@nishaatr
Copy link
Contributor

We should backport?

I wasn't planning on - no-one's raised it externally, and eventually it'll trickle out.

Ok. I think we should (at least 5.5.z/5) as looks a bit unprof.
Let me do the fix first and then take it from there.

@nishaatr
Copy link
Contributor

nishaatr commented Mar 13, 2025

Ok. I think we should (at least 5.5.z/5) as looks a bit unprof.
Let me do the fix first and then take it from there.

@JackPGreen I have updated README and works. Check?

OS: https://hub.docker.com/r/hazelcast/hazelcast
EE: https://hub.docker.com/r/hazelcast/hazelcast-enterprise

To update I ran https://github.com/hazelcast/hazelcast-docker/actions/runs/13832137620/job/38698647263
Removed everything except for publishing DH descript https://github.com/hazelcast/hazelcast-docker/blob/readme-fix/.github/workflows/tag_image_push.yml

Also, the <a> in GH is benign and not effecting the README

But this has changed the DH README

OS:

image

EE:

image

My branch was from your branch which is from master. The diff is from 5.3.8 I think

I think the way we build DH description is not right. The DH README is not versioned so whatever the last Docker version we build is what the README will become. Perhaps this needs discussing but for now let me know what you think?

UPDATE:

I have the previous DH REAME OS/EE markdown so I can revert if need be

UPDATE 2:

May be I should revert DH as only wanted to test.
We backport to z-branches only so next release will get fixed.
Optionally push to 5.5.5 as thats coming up

JackPGreen added a commit that referenced this pull request Mar 13, 2025
As discussed in #915 (comment), when a tag is pushed, we update the Docker Hub description based on the `README`... in that tag. Which means when a patch for an older version is released, we effectively roll back the description to an older version.

Changes:
- on tag `push`, update the Docker Hub description in a seperate job based on `master`
   - bonus - because it was in a matrix we _were_ doing it multiple times
- when the `README` or associated architecture is updated, rebuild as well
@JackPGreen
Copy link
Collaborator Author

@JackPGreen I have updated README and works. Check?

Looks good to me. Wondering if it's worth closing this PR and making a new one with an updated description now you've taken it over?

I think the way we build DH description is not right. The DH README is not versioned so whatever the last Docker version we build is what the README will become. Perhaps this needs discussing but for now let me know what you think?

Agreed - I'd noticed the same but didn't think it was causing a problem as we rarely update the README. But the IMDG reference is a problem.

I think we should rebuild the README when it's updated, or when a new tag is pushed - but based on master - #918

@nishaatr
Copy link
Contributor

Looks good to me. Wondering if it's worth closing this PR and making a new one with an updated description now you've taken it over?

Actually the README is from master on your branch so we can simply merge. I reverted your changes as I copied from master
This is appearing as a change for some reason but its just a revert.
I will approve this so lets just merge it

I think we should rebuild the README when it's updated, or when a new tag is pushed - but based on master - #918

Perfect. I was going to suggest this. I will review it shortly

@JackPGreen
Copy link
Collaborator Author

This is appearing as a change for some reason but its just a revert. I will approve this so lets just merge it

It's a change in line endings. Fixed in 67076ce

@JackPGreen JackPGreen merged commit 14ffc53 into master Mar 14, 2025
19 checks passed
@JackPGreen JackPGreen deleted the Fix-`README`-section-links-on-DockerHub branch March 14, 2025 13:01
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.

3 participants