-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(datasource): Add Nextcloud #37292
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
base: main
Are you sure you want to change the base?
Conversation
export const ApplicationRelease = z.object({ | ||
created: z.string(), | ||
isNightly: z.boolean(), | ||
translations: z.record(z.string(), Translation), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably use LooseRecord
, so it filters Translation
with missing changelog
and doesn't discard all
|
||
export const Application = z.object({ | ||
id: z.string(), | ||
releases: z.array(ApplicationRelease), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LooseArray
?
"customType": "regex", | ||
"managerFilePatterns": ["/(^|/)renovate.json$/"], | ||
"matchStrings": [ | ||
"https://apps.nextcloud.com/api/v1/platform/(?<currentValue>.*)/apps.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be non-greedy
"https://apps.nextcloud.com/api/v1/platform/(?<currentValue>.*)/apps.json" | |
"https://apps.nextcloud.com/api/v1/platform/(?<currentValue>.*?)/apps.json" |
or make even more tight
"https://apps.nextcloud.com/api/v1/platform/(?<currentValue>.*)/apps.json" | |
"https://apps.nextcloud.com/api/v1/platform/(?<currentValue>\\d+\\.\\d+\\.\\d+)/apps.json" |
import { cache } from '../../../util/cache/package/decorator'; | ||
import { regEx } from '../../../util/regex'; | ||
import { asTimestamp } from '../../../util/timestamp'; | ||
import * as semanticVersioning from '../../versioning/semver'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import * as semanticVersioning from '../../versioning/semver'; | |
import * as semver from '../../versioning/semver'; |
|
||
static readonly defaultTranslationLanguage = 'en'; | ||
|
||
override readonly defaultVersioning = semanticVersioning.id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
override readonly defaultVersioning = semanticVersioning.id; | |
override readonly defaultVersioning = semver.id; |
export class NextcloudDatasource extends Datasource { | ||
static readonly id = 'nextcloud'; | ||
|
||
static readonly defaultTranslationLanguage = 'en'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static readonly defaultTranslationLanguage = 'en'; | |
private static readonly defaultTranslationLanguage = 'en'; |
not externally used, move before public members
|
||
override readonly defaultVersioning = semanticVersioning.id; | ||
|
||
private static readonly sourceUrlRegex = regEx( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move before public properties
|
||
for (const release of application.releases) { | ||
const changelogContent = | ||
release.translations[NextcloudDatasource.defaultTranslationLanguage] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the translation is missing?
releaseTimestamp: asTimestamp(release.created), | ||
changelogContent: | ||
changelogContent.length > 0 ? changelogContent : undefined, | ||
changelogUrl: sourceUrlMatches?.groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set it on ReleaseResult
|
||
const result: ReleaseResult = { | ||
releases: [], | ||
homepage: application.website, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set sourceUrl
if the repo is on github
Changes
Add Nextcloud data source.
Example PR: bdovaz/renovate_test#20
Readme.md
custom manager example PR: bdovaz/renovate_test#18Context
#37256
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: