-
Notifications
You must be signed in to change notification settings - Fork 15
Closed as not planned
Closed as not planned
Copy link
Labels
💡 good first issuegood for newcomersgood for newcomers🤓 UXUX improvement for CLI usersUX improvement for CLI users🧩 cli
Description
Precondition:
- Issues sections should link to local file in your IDE at given commit with highlighted line(s) #745
- Issues sections should link to Git URL of file at given commit with highlighted line(s) #722
User story
As a user of the CLI I want to have click through experience for all actionable feedback a get from the audit issues.
At the moment no linking is present. What I need is a way to generate links depending on the current usecase.
- A) The report is located in your local file system
- B) The report is generate in the CI and added to a PR comment
- C) The report is checked in and lives in the repository
CLI argument Example:
npx @code-pushup collect- links in IDEnpx @code-pushup collect --git.host=https://my-github.com/repo-name --git.provider=github- links to git
Acceptance criteria
- The models package
- The CLI accepts the new git options
- By default the report links to the local filesystem. If the link is clicked you the fie is opened in the local IDE
- Over a configuration setting or terminal argument we can tell the CLI to generate links targeting another environment.
- If the configuration targets a local setup the first criteria applies
- If the the configuration targets a git-version e.g. GitLab, GitHub the URLs should get auto discovered
- If the server and git-version cant get autodetected we don't apply a link
Implementation details
PersistConfig Example:
type GitConfig = {
// skipped means local, otherwise remote
git?: {
provider: 'GitHub' | 'GitLab';
host?: string; // for self-hosted only, defaults to https://github.com or https://gitlab.com
}
}
const GitConfigSchema = z.object({
git: z
.object({
provider: z.enum(['GitHub', 'GitLab']),
host: z.string().url().optional(), // Optional host field with URL validation
})
.optional(), // git itself is optional
});type ReportOptions = {
sourceLinkFormatter: (source?: SourceFileLocation) => string
}
const sourceLinkFormatter = coreConfig.git ? ideLinkFn : cvsLinkFn;
const mdReport = generateMdReport(report: Report, options: ReportOptions) {
//
}Related Issues:
Metadata
Metadata
Assignees
Labels
💡 good first issuegood for newcomersgood for newcomers🤓 UXUX improvement for CLI usersUX improvement for CLI users🧩 cli