Clean up changelog output for copy-paste into devcenter#151
Open
schneems wants to merge 7 commits into
Open
Conversation
d9271ef to
c4a43fe
Compare
Contributor
Author
|
I triggered two dry runs so you can validate the new output:
|
The changelog binaries printed an internal "Add a changelog item: https://devcenter.heroku.com/admin/changelog_items/new" line as the first line of their output. When a maintainer copies the generated changelog to paste into the devcenter form, that instructional URL can get accidentally copied and posted to the public interface.
Build in its own step so compile/download output doesn't pollute the changelog step.
Problem: The output of the changelog entry on the summary is intended to be a copy/pasteable entry, however github summaries use markdown for styling so the contents are rendered instead of raw. To fix it we have to escape the contents by wrapping the changelog in a four-backtick fence.
This is needed because the changelog already uses three backticks in the output:
```ruby
Per https://github.github.com/gfm/#fenced-code-blocks
> The content of the code block consists of all subsequent lines, until a closing code fence of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence.
THe ruby one already printed to stdout.
Extract a pure render_jruby_changelog helper so the changelog output format can be unit tested without a network fetch, and add a regular_release test mirroring ruby_changelog. Adds pretty_assertions as a dev-dependency.
5889c63 to
133a6bc
Compare
```
Compiling ruby_executable v0.0.0 (/home/runner/work/docker-heroku-ruby-builder/docker-heroku-ruby-builder/ruby_executable)
Compiling jruby_executable v0.0.0 (/home/runner/work/docker-heroku-ruby-builder/docker-heroku-ruby-builder/jruby_executable)
error[E0308]: mismatched types
--> jruby_executable/src/bin/jruby_changelog.rs:22:28
|
22 | render_jruby_changelog(version, &stdlib_version, io)
| ---------------------- ^^^^^^^ expected `&str`, found `&JRubyVersion`
| |
| arguments to this function are incorrect
|
= note: expected reference `&str`
found reference `&JRubyVersion`
note: function defined here
--> jruby_executable/src/bin/jruby_changelog.rs:25:4
|
25 | fn render_jruby_changelog<W>(
| ^^^^^^^^^^^^^^^^^^^^^^
26 | version: &str,
| -------------
For more information about this error, try `rustc --explain E0308`.
error: could not compile `jruby_executable` (bin "jruby_changelog") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleans up the changelog printing for binary build steps. Details in commits.