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

Link directly to versioned changelog from gemspec #522

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

stoivo
Copy link
Contributor

@stoivo stoivo commented Sep 13, 2023

I like it a lot when the changelog url on rubygems link directly to the versions I updated to

With this code it will generate this diff. And this link takes you
directly to the changelog.

--- a/addressable.gemspec
+++ b/addressable.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
   s.version = "2.8.5"

   s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
-  s.metadata = { "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md" } if s.respond_to? :metadata=
+  s.metadata = { "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/addressable-2.8.5/CHANGELOG.md" } if s.respond_to? :metadata=
   s.require_paths = ["lib".freeze]
   s.authors = ["Bob Aman".freeze]
   s.date = "2023-08-03"
@dentarg
Copy link
Collaborator

dentarg commented Sep 13, 2023

I'm not sure about this change, the changelog can be updated after release too. For example, if we forgot something.

@stoivo
Copy link
Contributor Author

stoivo commented Sep 14, 2023

I didn't think, would be nice handle it somehow. I have a new idea. Since the title don't change we can do https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#addressable-284. If we we this with no other changes we will have issued with referencing the correct version. Update changelog.log with have titles like #Addressable 2.1.10 <a name="addressable-v2.1.10"> then we can link to it with https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#user-content-addressable-v2.1.10">.

Should I update the PR to this so you can see it for yourself?

@dentarg
Copy link
Collaborator

dentarg commented Sep 14, 2023

Sure, that's a good idea. Not sure I follow the last part though, does the actual CHANGELOG file need updating too? It would be best if it could be kept as-is and we make the changelog link be on the already auto-generated format https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#addressable-284

@sporkmonger
Copy link
Owner

sporkmonger commented Sep 19, 2023

I think it should be linked via the release tag, right?

Ah, NM, I see what you're getting at. Yeah, I'd be fine with using an anchor link too.

@stoivo
Copy link
Contributor Author

stoivo commented Sep 20, 2023

For all other project where I have seen changelog links to specific version, it has linked to the tag but as dentarg mentioned. We might want to add something to the changelog after the tag was made

This allows us to update the changelog after the tag was made.
@stoivo
Copy link
Contributor Author

stoivo commented Sep 20, 2023

So I have make some improvements. Which one do you prefer, should I drop the last commit?

@dentarg
Copy link
Collaborator

dentarg commented Sep 20, 2023

Sure, this looks good to me

I will just point out that it seems to work without user-content- part too: https://github.com/stoivo/addressable/blob/patch-1/CHANGELOG.md#v2.5.0

tasks/gem.rake Outdated Show resolved Hide resolved
tasks/gem.rake Outdated Show resolved Hide resolved
@stoivo
Copy link
Contributor Author

stoivo commented Sep 22, 2023

it is updated

@dentarg dentarg changed the title Update addressable.gemspec to link directly to versoned changelog Link directly to versioned changelog from gemspec Sep 22, 2023
@dentarg dentarg merged commit 60feb48 into sporkmonger:main Sep 22, 2023
33 checks passed
@stoivo stoivo deleted the patch-1 branch September 22, 2023 09:38
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.

3 participants