Skip to content

Commit 43785b0

Browse files
FantasyTeddyrarkinsRahulGautamSingh
authored
feat(nuget): add deprecation message for NuGet packages (renovatebot#36373)
Co-authored-by: Rhys Arkins <rhys@arkins.net> Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
1 parent fec81ba commit 43785b0

File tree

6 files changed

+343
-1
lines changed

6 files changed

+343
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>ProxyKit</id>
5+
<version>2.3.4+build.119</version>
6+
<authors>Damian Hickey</authors>
7+
<owners>Damian Hickey</owners>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<license type="expression">Apache-2.0</license>
10+
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl>
11+
<icon>icon.png</icon>
12+
<projectUrl>https://github.com/ProxyKit/ProxyKit</projectUrl>
13+
<description>An AspNet core middleware toolkit to create proxy servers. Can be embedded in applications or used as a standalone proxy.</description>
14+
<releaseNotes>See https://github.com/ProxyKit/ProxyKit/releases for release notes.</releaseNotes>
15+
<tags>aspnetcore proxy http</tags>
16+
<repository type="git" url="https://github.com/ProxyKit/ProxyKit" commit="5ce814152311938d323762474c8a3307d2beb2cf" />
17+
<dependencies>
18+
<group targetFramework=".NETCoreApp3.1" />
19+
<group targetFramework=".NETStandard2.0">
20+
<dependency id="Microsoft.AspNetCore.Http" version="2.1.0" exclude="Build,Analyzers" />
21+
<dependency id="Microsoft.AspNetCore.Http.Extensions" version="2.1.0" exclude="Build,Analyzers" />
22+
<dependency id="Microsoft.AspNetCore.HttpOverrides" version="2.1.0" exclude="Build,Analyzers" />
23+
<dependency id="Microsoft.Extensions.Http" version="2.1.0" exclude="Build,Analyzers" />
24+
</group>
25+
</dependencies>
26+
<frameworkReferences>
27+
<group targetFramework=".NETCoreApp3.1">
28+
<frameworkReference name="Microsoft.AspNetCore.App" />
29+
</group>
30+
</frameworkReferences>
31+
</metadata>
32+
</package>
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
{
2+
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/index.json",
3+
"@type": [
4+
"catalog:CatalogRoot",
5+
"PackageRegistration",
6+
"catalog:Permalink"
7+
],
8+
"commitId": "87fbae2e-a1be-4fd2-ab55-bfa4afb0b86a",
9+
"commitTimeStamp": "2024-11-13T10:18:14.1126201+00:00",
10+
"count": 1,
11+
"items": [
12+
{
13+
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/index.json#page/1.0.0-alpha.1/2.3.4",
14+
"@type": "catalog:CatalogPage",
15+
"commitId": "87fbae2e-a1be-4fd2-ab55-bfa4afb0b86a",
16+
"commitTimeStamp": "2024-11-13T10:18:14.1126201+00:00",
17+
"count": 24,
18+
"items": [
19+
{
20+
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/1.0.0.json",
21+
"@type": "Package",
22+
"commitId": "b8608975-ebf6-4185-8e46-ae676b218a2b",
23+
"commitTimeStamp": "2024-11-13T10:16:09.6743205+00:00",
24+
"catalogEntry": {
25+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json",
26+
"@type": "PackageDetails",
27+
"authors": "Damian Hickey",
28+
"dependencyGroups": [
29+
{
30+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#dependencygroup/.netstandard2.0",
31+
"@type": "PackageDependencyGroup",
32+
"dependencies": [
33+
{
34+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.http",
35+
"@type": "PackageDependency",
36+
"id": "Microsoft.AspNetCore.Http",
37+
"range": "[2.2.0, )",
38+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.http/index.json"
39+
},
40+
{
41+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.http.extensions",
42+
"@type": "PackageDependency",
43+
"id": "Microsoft.AspNetCore.Http.Extensions",
44+
"range": "[2.2.0, )",
45+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.http.extensions/index.json"
46+
},
47+
{
48+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.httpoverrides",
49+
"@type": "PackageDependency",
50+
"id": "Microsoft.AspNetCore.HttpOverrides",
51+
"range": "[2.2.0, )",
52+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.httpoverrides/index.json"
53+
},
54+
{
55+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#dependencygroup/.netstandard2.0/microsoft.extensions.http",
56+
"@type": "PackageDependency",
57+
"id": "Microsoft.Extensions.Http",
58+
"range": "[2.2.0, )",
59+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.extensions.http/index.json"
60+
}
61+
],
62+
"targetFramework": ".NETStandard2.0"
63+
}
64+
],
65+
"deprecation": {
66+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.1.0.0.json#deprecation",
67+
"@type": "deprecation",
68+
"reasons": [
69+
"Legacy"
70+
]
71+
},
72+
"description": "An AspNet core middleware toolkit to create proxy servers. Can\n be used in applications or used as a standalone proxy (i.e. containerised system).",
73+
"iconUrl": "",
74+
"id": "ProxyKit",
75+
"language": "",
76+
"licenseExpression": "",
77+
"licenseUrl": "https://github.com/damianh/ProxyKit/blob/master/LICENSE",
78+
"listed": false,
79+
"minClientVersion": "",
80+
"packageContent": "https://api.nuget.org/v3-flatcontainer/proxykit/1.0.0/proxykit.1.0.0.nupkg",
81+
"projectUrl": "https://github.com/damianh/ProxyKit",
82+
"published": "1900-01-01T00:00:00+00:00",
83+
"requireLicenseAcceptance": false,
84+
"summary": "",
85+
"tags": [
86+
"aspnetcore",
87+
"proxy",
88+
"http"
89+
],
90+
"title": "",
91+
"version": "1.0.0+build.118"
92+
},
93+
"packageContent": "https://api.nuget.org/v3-flatcontainer/proxykit/1.0.0/proxykit.1.0.0.nupkg",
94+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/index.json"
95+
},
96+
{
97+
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/2.3.4.json",
98+
"@type": "Package",
99+
"commitId": "b8608975-ebf6-4185-8e46-ae676b218a2b",
100+
"commitTimeStamp": "2024-11-13T10:16:09.6743205+00:00",
101+
"catalogEntry": {
102+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json",
103+
"@type": "PackageDetails",
104+
"authors": "Damian Hickey",
105+
"dependencyGroups": [
106+
{
107+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netcoreapp3.1",
108+
"@type": "PackageDependencyGroup",
109+
"targetFramework": ".NETCoreApp3.1"
110+
},
111+
{
112+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netstandard2.0",
113+
"@type": "PackageDependencyGroup",
114+
"dependencies": [
115+
{
116+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.http",
117+
"@type": "PackageDependency",
118+
"id": "Microsoft.AspNetCore.Http",
119+
"range": "[2.1.0, )",
120+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.http/index.json"
121+
},
122+
{
123+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.http.extensions",
124+
"@type": "PackageDependency",
125+
"id": "Microsoft.AspNetCore.Http.Extensions",
126+
"range": "[2.1.0, )",
127+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.http.extensions/index.json"
128+
},
129+
{
130+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netstandard2.0/microsoft.aspnetcore.httpoverrides",
131+
"@type": "PackageDependency",
132+
"id": "Microsoft.AspNetCore.HttpOverrides",
133+
"range": "[2.1.0, )",
134+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.aspnetcore.httpoverrides/index.json"
135+
},
136+
{
137+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#dependencygroup/.netstandard2.0/microsoft.extensions.http",
138+
"@type": "PackageDependency",
139+
"id": "Microsoft.Extensions.Http",
140+
"range": "[2.1.0, )",
141+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/microsoft.extensions.http/index.json"
142+
}
143+
],
144+
"targetFramework": ".NETStandard2.0"
145+
}
146+
],
147+
"deprecation": {
148+
"@id": "https://api.nuget.org/v3/catalog0/data/2024.11.13.10.15.11/proxykit.2.3.4.json#deprecation",
149+
"@type": "deprecation",
150+
"reasons": [
151+
"Legacy"
152+
]
153+
},
154+
"description": "An AspNet core middleware toolkit to create proxy servers. Can be embedded in applications or used as a standalone proxy.",
155+
"iconUrl": "https://api.nuget.org/v3-flatcontainer/proxykit/2.3.4/icon",
156+
"id": "ProxyKit",
157+
"language": "",
158+
"licenseExpression": "Apache-2.0",
159+
"licenseUrl": "https://www.nuget.org/packages/ProxyKit/2.3.4/license",
160+
"listed": false,
161+
"minClientVersion": "",
162+
"packageContent": "https://api.nuget.org/v3-flatcontainer/proxykit/2.3.4/proxykit.2.3.4.nupkg",
163+
"projectUrl": "https://github.com/ProxyKit/ProxyKit",
164+
"published": "1900-01-01T00:00:00+00:00",
165+
"requireLicenseAcceptance": false,
166+
"summary": "",
167+
"tags": [
168+
"aspnetcore",
169+
"proxy",
170+
"http"
171+
],
172+
"title": "",
173+
"version": "2.3.4+build.119"
174+
},
175+
"packageContent": "https://api.nuget.org/v3-flatcontainer/proxykit/2.3.4/proxykit.2.3.4.nupkg",
176+
"registration": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/index.json"
177+
}
178+
],
179+
"parent": "https://api.nuget.org/v3/registration5-gz-semver2/proxykit/index.json",
180+
"lower": "1.0.0-alpha.1",
181+
"upper": "2.3.4"
182+
}
183+
],
184+
"@context": {
185+
"@vocab": "http://schema.nuget.org/schema#",
186+
"catalog": "http://schema.nuget.org/catalog#",
187+
"xsd": "http://www.w3.org/2001/XMLSchema#",
188+
"items": {
189+
"@id": "catalog:item",
190+
"@container": "@set"
191+
},
192+
"commitTimeStamp": {
193+
"@id": "catalog:commitTimeStamp",
194+
"@type": "xsd:dateTime"
195+
},
196+
"commitId": {
197+
"@id": "catalog:commitId"
198+
},
199+
"count": {
200+
"@id": "catalog:count"
201+
},
202+
"parent": {
203+
"@id": "catalog:parent",
204+
"@type": "@id"
205+
},
206+
"tags": {
207+
"@id": "tag",
208+
"@container": "@set"
209+
},
210+
"reasons": {
211+
"@container": "@set"
212+
},
213+
"packageTargetFrameworks": {
214+
"@id": "packageTargetFramework",
215+
"@container": "@set"
216+
},
217+
"dependencyGroups": {
218+
"@id": "dependencyGroup",
219+
"@container": "@set"
220+
},
221+
"dependencies": {
222+
"@id": "dependency",
223+
"@container": "@set"
224+
},
225+
"packageContent": {
226+
"@type": "@id"
227+
},
228+
"published": {
229+
"@type": "xsd:dateTime"
230+
},
231+
"registration": {
232+
"@type": "@id"
233+
}
234+
}
235+
}

lib/modules/datasource/nuget/__snapshots__/index.spec.ts.snap

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,3 +1986,21 @@ exports[`modules/datasource/nuget/index > getReleases > returns deduplicated res
19861986
"sourceUrl": "https://github.com/nunit/nunit",
19871987
}
19881988
`;
1989+
1990+
exports[`modules/datasource/nuget/index > getReleases > should return deprecated 1`] = `
1991+
{
1992+
"deprecationMessage": "The package \`ProxyKit\` is deprecated.",
1993+
"registryUrl": "https://api.nuget.org/v3/index.json",
1994+
"releases": [
1995+
{
1996+
"isDeprecated": true,
1997+
"version": "1.0.0",
1998+
},
1999+
{
2000+
"isDeprecated": true,
2001+
"version": "2.3.4",
2002+
},
2003+
],
2004+
"sourceUrl": "https://github.com/ProxyKit/ProxyKit",
2005+
}
2006+
`;

lib/modules/datasource/nuget/index.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const packageCache = vi.mocked(_packageCache);
2121
const pkgInfoV3FromNuget = Fixtures.get('nunit/v3_nuget_org.xml');
2222
const pkgListV3Registration = Fixtures.get('nunit/v3_registration.json');
2323

24+
const pkgInfoV3Deprecated = Fixtures.get('proxykit/v3.xml');
25+
const pkgListV3Deprecated = Fixtures.get('proxykit/v3_registration.json');
26+
2427
const pkgListV2 = Fixtures.get('nunit/v2.xml');
2528
const pkgListV2NoGitHubProjectUrl = Fixtures.get(
2629
'nunit/v2_noGitHubProjectUrl.xml',
@@ -108,6 +111,13 @@ const configV3AzureDevOps = {
108111
],
109112
};
110113

114+
const configV3Deprecated = {
115+
datasource,
116+
versioning,
117+
packageName: 'ProxyKit',
118+
registryUrls: ['https://api.nuget.org/v3/index.json'],
119+
};
120+
111121
describe('modules/datasource/nuget/index', () => {
112122
beforeEach(() => {
113123
GlobalConfig.reset();
@@ -820,5 +830,22 @@ describe('modules/datasource/nuget/index', () => {
820830
expect(res).not.toBeNull();
821831
expect(res).toMatchSnapshot();
822832
});
833+
834+
it('should return deprecated', async () => {
835+
httpMock
836+
.scope('https://api.nuget.org')
837+
.get('/v3/index.json')
838+
.twice()
839+
.reply(200, nugetIndexV3)
840+
.get('/v3/registration5-gz-semver2/proxykit/index.json')
841+
.reply(200, pkgListV3Deprecated)
842+
.get('/v3-flatcontainer/proxykit/2.3.4/proxykit.nuspec')
843+
.reply(200, pkgInfoV3Deprecated);
844+
const res = await getPkgReleases({
845+
...configV3Deprecated,
846+
});
847+
expect(res).not.toBeNull();
848+
expect(res).toMatchSnapshot();
849+
});
823850
});
824851
});

lib/modules/datasource/nuget/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export interface CatalogEntry {
1212
projectUrl?: string;
1313
listed?: boolean;
1414
packageContent?: string;
15+
deprecation?: Deprecation;
16+
}
17+
18+
export interface Deprecation {
19+
reasons: string[];
1520
}
1621

1722
export interface CatalogPage {

0 commit comments

Comments
 (0)