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

[FEATURE REQUEST] Add Link to GitHub repo #67

Closed
Buddinski88 opened this issue Feb 2, 2024 · 15 comments · Fixed by #97
Closed

[FEATURE REQUEST] Add Link to GitHub repo #67

Buddinski88 opened this issue Feb 2, 2024 · 15 comments · Fixed by #97
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Buddinski88
Copy link

Hi mag37,

I have another idea 😊

At the moment I only check if there are new versions, because I always like to check beforehand if there is a breaking change in a miner service, i.e. I look at the release notes.

Wouldn't it be cool if the link to the GitHub repo was displayed directly after checking each service?

Best regards
Buddinski88

@mag37
Copy link
Owner

mag37 commented Feb 2, 2024

It's an interesting idea, I've been trying to look into how to implement some kind of changelog scrape option, to get linked to or brief cutout from container changelogs. But there's so many different container maintainers and there's no real standard on how things are documented - so not the easiest task to achieve.

While your suggestion would be simpler than a full changelog grab for each container - it's still not simple - not all containers have a clear github page.

@Buddinski88
Copy link
Author

That's what I suspected, so at least the link to GitHub would be helpful so that I could look it up myself.
Alternatively, I had the idea of showing the current and latest releases in the form of a version? Something like Current version 2.10 > Latest version 2.20?

@mag37
Copy link
Owner

mag37 commented Feb 3, 2024

If there was a simple way to check current VS latest version, I could remove 50% of this script 😅.

There is no real clear/standard in versioning and presenting versions in each image. Thats why currently the script checks the hashed digest of the current local image and compare it to the latest digest of the same tag - if they're not the same, its an update.
It doesn't know what version or how many versions have passed, only that the local image is not the newest.

So to GitHub links - not all images/containers have a GitHub page. And there's no automatic connection between an image repo and their GitHub page, so that would need guesswork.

There's many registries, to name a few:

  • Docker Hub
  • Harbor
  • GitHub Container Registry
  • Red Hat Quay
  • Google Container Registry
  • Azure Container Registry
  • Amazon ECR
    and more.

Where containers are pulled from, so many of those do not have a link to a corresponding GitHub page.

If you wanna figure it out I'm happy to try to implement something - but for now it's too large a project for me to work on myself.

@Joop9
Copy link

Joop9 commented Sep 10, 2024

When there are updates, I receive a (mail) notification with a list of container names where updates are available.
Is it possible to create a file with a list of container names and the corresponding link to the release note (manually, by the user) and do a lookup search for the corresponding name and paste the link into the notification?

example of lookup file:
zigbee2mqtt https://github.com/Koenkk/zigbee2mqtt/releases/latest
hass https://www.home-assistant.io/blog/categories/core/
mariadb https://mariadb.com/kb/en/release-notes/

Best regards,
Joop9

@mag37
Copy link
Owner

mag37 commented Sep 10, 2024

...
Is it possible to create a file with a list of container names and the corresponding link to the release note (manually, by the user) and do a lookup search for the corresponding name and paste the link into the notification?
...
Best regards, Joop9

It's a great suggestion! Though I don't have time to work on a solution right now but I'll try to find some time to look at it soon. I think it's smart to have the user create the list themselves - as you and me might have different names on the same container, and maybe different locations from where we find the info.

So what I'd look into is to make a function to take the list of updates available, then add a link to release notes if the container name is found in the user provided list. I'd probably make this a new file with the function inside + a way for the user to add the list in that same file. Then just source it/call it as a function from the notify.sh.

@mag37 mag37 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 14, 2024
@mag37
Copy link
Owner

mag37 commented Oct 2, 2024

@Joop9 I've created a snipped to include/modify into the notify.sh of choice, if you'd like to try it out I'd be happy for any criticism or feedback!

See releasenotes.sh and corresponding urls.list.

Is this a somewhat reasonable approach?

Edit: And @Buddinski88 - I'd like your view too, if you think this is enough.

@Joop9
Copy link

Joop9 commented Oct 3, 2024 via email

@mag37
Copy link
Owner

mag37 commented Oct 3, 2024

Thank you for testing.

Oh yes, it will just print every line that have the correct container name in the left column I'm afraid. No matter how many times its listed.

Anything you think I should modify?

@yoyoma2
Copy link
Contributor

yoyoma2 commented Oct 4, 2024

This sounds quite useful but kind of difficult to configure.

Couldn't the releasenotes function be in the dockcheck.sh script (no releasenotes.sh to download and update/maintain)?
Couldn't that line already be added to all the notification templates but checking for the existence of urls.list (not releasenotes.sh) to activate the feature (no error prone line adding).
Would the urls.list file accept additions from users? It would be nice if the example file grew to include the most commonly used containers. Always nice to enjoy other people's contributions.
Displaying "Release notes url not configured" next to each image or some message making users aware of this cool feature.

This way downloading urls.list would be enough to enable this feature assuming my images are already in urls.list.

Just brainstorming ways to make this cool feature easy for users. Feel free to ignore. 😀

@Joop9
Copy link

Joop9 commented Oct 4, 2024 via email

@mag37
Copy link
Owner

mag37 commented Oct 4, 2024

@yoyoma2
That's great and valid points! I was considering to bake it in more when I've had some testing done (and with feedback from users). I did not want to interfere with all notify-"plugins" and the main script if it wasn't useful/wanted.

Happy you brainstorm! Makes it easier for me to know the direction, what might be useful and what might be too much.

Would be great if there could be an example file of urls.list that could be appended by users! Having some guidelines and generic naming of containers.

I'll do some thinking and overhaul of how this should be implemented in the main script - as I don't want to screw up the output of "Containers with updates available" etc. But would be great if it was just included and only used when urls.list is sourced.


@Joop9
Thank you, mistake by my part - I'll add it straight away.

@mag37
Copy link
Owner

mag37 commented Oct 4, 2024

I created a branch with the new work: releasenotes

Some edits and testing needed - only added the line to notify_generic.sh template yet.
If anyone uses some kind of notification I'd be very happy if you could test it. I'll see if I can try some apprise and telegram later.

@yoyoma2
Copy link
Contributor

yoyoma2 commented Oct 4, 2024

Tried on DSM. It works great unless an update is available for the last container listed in urls.list. In that case the last statement to run is [[ $found == false ]] which sets a return status of 1. Putting true as the last line of releasenotes() did the trick (type true tells me it's a shell builtin so not costly).

Could you add this line to the sample urls.list file?
vaultwarden-server https://github.com/dani-garcia/vaultwarden/releases

@mag37
Copy link
Owner

mag37 commented Oct 4, 2024

Thank you, well spotted!
I changed that line to [[ $found == false ]] && printf "%s -> url missing\n" "$update" || continue which seemed more appropriate and should make it return 0.

I've tested it on apprise-api and telegram too, so might patch it to main soon! Thanks for testing and debugging.

@mag37 mag37 linked a pull request Oct 4, 2024 that will close this issue
@mag37 mag37 closed this as completed in #97 Oct 4, 2024
@mag37
Copy link
Owner

mag37 commented Oct 4, 2024

Merged to main. Thank you again all of you, @Buddinski88 @Joop9 @yoyoma2 .
I mentioned you all in the release notes, appreciate the help and feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants