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

Issues/PR in Changelogs from GitHub Enterprise Server should point to that Enterprise Server instead of github.com #19228

Closed
Shegox opened this issue Dec 2, 2022 · 3 comments
Labels
core:changelogs Related to changelogs/release notes fetching priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@Shegox
Copy link
Contributor

Shegox commented Dec 2, 2022

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

34.41.0

If you're self-hosting Renovate, select which platform you are using.

GitHub Enterprise Server

If you're self-hosting Renovate, tell us what version of the platform you run.

3.5.5

Was this something which used to work for you, and then stopped?

I never saw this working

Describe the bug

When Renovate adds Changelogs from internal packages hosted on GitHub Enterprise Server (GHES) and they only contain references like #16, Renovate leverages the below function to translate them to actual GitHub links.

/**
*
* @param content content to process
* @param options github options
* @returns linkified content
*/
export async function linkify(
content: string,
options: github.RemarkGithubOptions
): Promise<string> {
// https://github.com/syntax-tree/mdast-util-to-markdown#optionsbullet
const output = await remark()
.use({ settings: { bullet: '-' } })
.use(github, { mentionStrong: false, ...options })
.process(content);
return output.toString();
}

Currently these links always point to github.com and not to the hosted GitHub Enterprise Server.

This can be archived with speciying a custom buildUrl in remarkJS.


Currently following happens:

A changelog like this
image

gets transformed to this markdown:

### Release Notes

<details>
<summary>my-org/my-dependency-repo</summary>

### [`v0.4.3`](https://github.enterprise.com/my-org/my-dependency-repo/blob/HEAD/CHANGELOG.md#&#8203;043---2022-12-02)

-   Automate GitHub Releases ([#&#8203;16](https://github.com/my-org/my-dependency-repo/issues/16))

The expected markdown should look like this:

### Release Notes

<details>
<summary>my-org/my-dependency-repo</summary>

### [`v0.4.3`](https://github.enterprise.com/my-org/my-dependency-repo/blob/HEAD/CHANGELOG.md#&#8203;043---2022-12-02)

-   Automate GitHub Releases ([#&#8203;16](https:///github.enterprise.com/my-org/my-dependency-repo/issues/16))

I will create a PR next week to address this.

Relevant debug logs

n/a

Have you created a minimal reproduction repository?

No reproduction repository

@Shegox Shegox added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Dec 2, 2022
@Shegox Shegox changed the title linkify Issues/PR in Changelogs from GitHub Enterprise Server should point to that Enterprise Server instead of github.com Dec 2, 2022
@rarkins rarkins added core:changelogs Related to changelogs/release notes fetching priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:ready and removed priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started labels Dec 3, 2022
@Shegox
Copy link
Contributor Author

Shegox commented Dec 9, 2022

After digging a bit into it, it seems that the baseUrl option to change the GitHub base url requires github-remark v11 (Renovate currently uses github-remark v10). github-remark v11 is distributed as ESM only and therefore can't be used.

Because of that and because I don't see a quick workaround I would put it on hold until ESM support is added in Renovate:

If we really want to add it now, we could ask if the github-remark project backports the feature to v10 and releases that as commonjs module -or- do that ourself and use a fork of it.

@rarkins
Copy link
Collaborator

rarkins commented Dec 23, 2022

I'm going to close this as a duplicate of #19503 because I think it's the same problem and that one has a reproduction using gitlab.com

@rarkins
Copy link
Collaborator

rarkins commented Dec 23, 2022

Duplicate of #19503

@rarkins rarkins marked this as a duplicate of #19503 Dec 23, 2022
@rarkins rarkins closed this as not planned Won't fix, can't repro, duplicate, stale Dec 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core:changelogs Related to changelogs/release notes fetching priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants