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

PMM-13361 format release notes #365

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

idoqo
Copy link
Contributor

@idoqo idoqo commented Jan 22, 2025

PMM-13361 and PMM-13077.

Closes #284

@JNKPercona
Copy link

Test name Status
api-tests failed

1 similar comment
@JNKPercona
Copy link

Test name Status
api-tests failed

@JNKPercona
Copy link

Test name Status
api-tests failed

@idoqo idoqo marked this pull request as ready for review January 22, 2025 11:09
@JNKPercona
Copy link

Test name Status
api-tests failed

README.md Outdated
@@ -58,6 +58,14 @@ supported:
`recommended` field holds a specific version. `supported` hold a semver constraint.

Making a request to `/metadata/v1/{product}` will return all stored metadata for the given product.
## How to add new release notes for a product
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## How to add new release notes for a product
## How to add new release notes for a product

README.md Outdated
## How to add new release notes for a product
Add a file to `sources/release-notes/{product_name}/{version-tag}.md`.

Making a request to `/release-notes/v1/{product}/{version-tag}` will return the release note for that version in raw markdown format.
Copy link
Contributor

Choose a reason for hiding this comment

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

let's move it to the end of this block

README.md Outdated
Add a file to `sources/release-notes/{product_name}/{version-tag}.md`.

Making a request to `/release-notes/v1/{product}/{version-tag}` will return the release note for that version in raw markdown format.
You can also run `make format-release-notes` to format the release notes. This command will:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can also run `make format-release-notes` to format the release notes. This command will:
Run `make format-release-notes` to format the release notes. This command will:


// isRelativeLink checks if a given image or link uses a relative path.
func isRelativeLink(link string) bool {
return strings.HasPrefix(link, "../") || strings.HasPrefix(link, "#")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should use url.Parse to check if it's absolute URL. Some URLs can start with / if I'm not mistaken

if link, ok := node.(*ast.Link); ok && entering {
target := string(link.Destination)
if isRelativeLink(target) && strings.HasPrefix(target, "../") {
newDestination := baseMarkdownURL + strings.Replace(target, "../", "", 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we try ResolveReference instead?

-![!image](../_images/Max_Connection_Limit.png)`),
expected: []byte(`### PMM 2.42.0

Welcome to PMM [v2.42](https://github.com/percona/pmm-doc/tree/main/docs/index.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

should it lead to github instead of https://docs.percona.com/percona-monitoring-and-management/3/index.html?
BTW we already migrated from percona/pmm-doc to percona/pmm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, the reason here was that different relative markdown links can link to different links (not just release notes for instance), and it's hard to define the proper link

Copy link
Contributor

Choose a reason for hiding this comment

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

@idoqo can you provide a few example in existing release notes, please?
@catalinaadam can you help with this, please?

"os"
"path/filepath"

"github.com/alecthomas/kingpin/v2"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's use kong since kingpin isn't supported anymore.

Comment on lines +7 to +12
"github.com/Kunde21/markdownfmt/v3/markdown"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
Copy link
Contributor

Choose a reason for hiding this comment

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

please format imports

@JNKPercona
Copy link

Test name Status
api-tests failed

@idoqo idoqo requested a review from BupycHuk January 22, 2025 22:55
@JNKPercona
Copy link

Test name Status
api-tests failed

1 similar comment
@JNKPercona
Copy link

Test name Status
api-tests failed

@idoqo idoqo force-pushed the PMM-13361-format-release-notes branch from d82a8fc to 2dbfcdc Compare January 23, 2025 10:43
@JNKPercona
Copy link

Test name Status
api-tests failed

@JNKPercona
Copy link

Test name Status
api-tests failed

@JNKPercona
Copy link

Test name Status
api-tests passed

1 similar comment
@JNKPercona
Copy link

Test name Status
api-tests passed

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