Skip to content

feat: changelog - formatted links, more git providers & copy markdown#2983

Open
WilcoSp wants to merge 303 commits into
npmx-dev:mainfrom
WilcoSp:changelog/format-link+git-providers+copy-markdown
Open

feat: changelog - formatted links, more git providers & copy markdown#2983
WilcoSp wants to merge 303 commits into
npmx-dev:mainfrom
WilcoSp:changelog/format-link+git-providers+copy-markdown

Conversation

@WilcoSp

@WilcoSp WilcoSp commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

preview

🔗 Linked issue

🧭 Context

  • Adding support for more git providers
  • Adding formatting for issues, pr/mr, commits, accounts and compare from plaintext to formatted link and unformatted link to a formatted link
  • adds button to copy the markdown from

📚 Description

  • Before only github was supported, in this pr also other git providers will be added and are included with the other 2 additions
    added providers:
    • Codeberg & Forgejo
    • Gitlab
    • tangled (does current have both issue & pr as #, will in the future change due to tangled not having shorthands yet)
      (the following aren't required for this pr, just nice to have and are here if review takes long)
    • bitbucket
    • Gitea
    • Radicle
    • Sourcehut
    • Gitee

Adding support to format links to the git providers (same repo only):

  • convert unformatted links for issues, pr/mr, commit & compare to a formatted link
  • convert plaintext issues, pr/mr, account & commit to formatted links to the git providers

Added button to allow copying the raw markdown

  • copy from release
  • copy from changelog.md

I did only use AI for some of the regular expressions

this pr continued from #2717 which continued from the pr before, that's why there are so many commits

WilcoSp and others added 30 commits February 27, 2026 00:08
added scroll margin classes
ensuring to navigate to hash if present
… back

releases title's will now use slugify instead of encodeUri to fix issues with encoding
WilcoSp added 3 commits July 11, 2026 14:28
given changelogCard now also host
added tests to ensure that email & package@version isn't formatted to a git link
…ithub.com:WilcoSp/npmx.dev into changelog/format-link+git-providers+copy-markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
shared/utils/git-providers.ts (1)

291-291: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type NEED_HOST as ProviderId[].

Currently inferred as string[], so invalid or misspelt provider IDs would not be caught at compile time.

As per coding guidelines: "Ensure you write strictly type-safe code".

♻️ Proposed change
-export const NEED_HOST = ['gitlab', 'gitea', 'forgejo', 'radicle']
+export const NEED_HOST: ProviderId[] = ['gitlab', 'gitea', 'forgejo', 'radicle']
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shared/utils/git-providers.ts` at line 291, Type the NEED_HOST constant
explicitly as ProviderId[] so its provider entries are compile-time validated.
Preserve the existing provider values and locate the change at the NEED_HOST
declaration.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shared/utils/git-providers.ts`:
- Around line 305-311: Update the provider parsing logic around the discarded
NEED_HOST.includes(provider.id) expression to retain its boolean result, then
use that result when assigning host in the returned object. Ensure host is
populated only for providers listed in NEED_HOST and remains undefined for all
others.

---

Nitpick comments:
In `@shared/utils/git-providers.ts`:
- Line 291: Type the NEED_HOST constant explicitly as ProviderId[] so its
provider entries are compile-time validated. Preserve the existing provider
values and locate the change at the NEED_HOST declaration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 13f42098-7fdb-46aa-aa4c-f442d909cdaa

📥 Commits

Reviewing files that changed from the base of the PR and between 4d504b1 and 535dbdd.

📒 Files selected for processing (9)
  • app/components/Changelog/Card.vue
  • app/components/Changelog/Releases.vue
  • server/api/changelog/md/[provider]/[owner]/[repo]/[...path].get.ts
  • server/api/changelog/releases/[provider]/[owner]/[repo].get.ts
  • server/api/changelog/releases/[provider]/[owner]/[repo]/raw/[tag].get.ts
  • server/utils/changelog/validateHost.ts
  • shared/utils/constants.ts
  • shared/utils/git-providers.ts
  • test/unit/server/utils/changelog/markdown.spec.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • app/components/Changelog/Releases.vue
  • app/components/Changelog/Card.vue
  • server/api/changelog/releases/[provider]/[owner]/[repo]/raw/[tag].get.ts
  • server/api/changelog/md/[provider]/[owner]/[repo]/[...path].get.ts
  • server/api/changelog/releases/[provider]/[owner]/[repo].get.ts
  • test/unit/server/utils/changelog/markdown.spec.ts

Comment thread shared/utils/git-providers.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/unit/server/utils/changelog/validateHost.spec.ts`:
- Line 52: Correct the describe block title in the host validation tests by
changing “know host” to “known host”; leave the test behavior unchanged.
- Line 46: Correct the typo in the test description for the “require radicle to
have a host” case by changing “shoud” to “should.”
- Around line 179-182: Correct the test description in the radicle host
validation test so it states that gitea.com should be rejected or disallowed.
Keep the existing createSchema('radicle') setup and toBeFalsy assertion
unchanged.
- Around line 19-27: Update the second test description in the changelog host
validation tests to say it allows tangled without a host, while leaving its
createSchema('tangled') setup and assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 700712cc-2f91-4022-a66a-ee0ede851d79

📥 Commits

Reviewing files that changed from the base of the PR and between c7b9443 and 9533791.

📒 Files selected for processing (5)
  • server/utils/changelog/detectChangelog.ts
  • server/utils/changelog/markdown.ts
  • server/utils/changelog/validateHost.ts
  • shared/utils/constants.ts
  • test/unit/server/utils/changelog/validateHost.spec.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • server/utils/changelog/validateHost.ts
  • shared/utils/constants.ts
  • server/utils/changelog/detectChangelog.ts
  • server/utils/changelog/markdown.ts

Comment thread test/unit/server/utils/changelog/validateHost.spec.ts
Comment thread test/unit/server/utils/changelog/validateHost.spec.ts Outdated
Comment thread test/unit/server/utils/changelog/validateHost.spec.ts Outdated
Comment thread test/unit/server/utils/changelog/validateHost.spec.ts Outdated
@WilcoSp

WilcoSp commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai is there anything left that should be addressed in this pr?

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
gh pr view 2983 --repo npmx-dev/npmx.dev --json reviews,comments -q '.reviews[] | {author: .author.login, body: .body, state: .state}' | head -200
echo "---REVIEW COMMENTS---"
gh api repos/npmx-dev/npmx.dev/pulls/2983/comments --paginate | jq -r '.[] | select(.user.login=="coderabbitai") | "ID:\(.id) PATH:\(.path) LINE:\(.line) BODY:\(.body[0:200])"'

Length of output: 23556


🏁 Script executed:

#!/bin/bash
gh api graphql -f query='
query {
  repository(owner: "npmx-dev", name: "npmx.dev") {
    pullRequest(number: 2983) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          path
          line
          comments(first: 1) {
            nodes {
              author { login }
              body
            }
          }
        }
      }
    }
  }
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.comments.nodes[0].author.login=="coderabbitai") | {path, line, isResolved, isOutdated, body: .comments.nodes[0].body[0:150]}'

Length of output: 5640


All review threads from CodeRabbit are resolved. Nothing outstanding remains from my automated review.

@WilcoSp all the review threads I opened on this PR are marked resolved — that covers the SSRF fixes for host params, the Tangled dispatch additions, the ROOT_ONLY_REGEX fix, account-mention regex fix, and the various typo/wording fixes. I don't see any unresolved actionable comments from me at this point.

A couple of earlier nitpicks (non-blocking, lower priority) that I don't have a resolved/unresolved thread confirmation for, in case you want to double check they were addressed:

  • Missing User-Agent header on the Forgejo/GitLab $fetch calls in server/api/changelog/releases/[provider]/[owner]/[repo]/raw/[tag].get.ts.
  • No timeout on the fetch call in checkFiles (server/utils/changelog/detectChangelog.ts).
  • Typing NEED_HOST as ProviderId[] in shared/utils/git-providers.ts.

If those are already handled, feel free to ignore this. Otherwise, this PR looks ready from my side.

@WilcoSp WilcoSp mentioned this pull request Jul 15, 2026
3 tasks
@WilcoSp

WilcoSp commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

I've just done the last bits that needed to be addressed, so for right now I do think this pr is complete and really ready for review.

@ghostdevv

ghostdevv commented Jul 22, 2026

Copy link
Copy Markdown
Member

I've just done the last bits that needed to be addressed, so for right now I do think this pr is complete and really ready for review.

before I review, are there any parts to this PR that can be split up into multiple PRs? One indicator to me is that the PR title contains multiple distinct features - also see above

@WilcoSp

WilcoSp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

no, these features can't be split off to separate PRs as during development they're made to work together, mostly with the multiple git providers support.

@ghostdevv ghostdevv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

quick first pass

Comment thread test/nuxt/a11y.spec.ts
})

describe('TabRoot + TabList + TabItem + TabPanel', () => {
function createTabsFixture(modelValue: string, idPrefix: string) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's a lint warning on this line

@@ -0,0 +1,15 @@
import { NEED_HOST, type ProviderId } from '~~/shared/utils/git-providers'
import { custom, optional } from 'valibot'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you import this as import * as v from 'valibot' for consistency

}
}

// source https://raw.githubusercontent.com/potch/sowpods/refs/heads/master/SOWPODS.txt and filtered with /^[a-f]{6,40}$/i

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what's this?

Comment on lines +249 to +250
// return text

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// return text

ForgejoReleaseCollectionSchema,
GitlabReleaseCollectionSchema,
} from '~~/shared/schemas/changelog/release'
import { parse } from 'valibot'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

v.parse (valibot is already imported also)

: []),
])

//fetch README file as Markdown to copy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
//fetch README file as Markdown to copy
// fetch README file as Markdown to copy

Comment on lines +69 to +70
</script>
<template>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
</script>
<template>
</script>
<template>

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.

2 participants