-
Notifications
You must be signed in to change notification settings - Fork 5
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
How old deps #255
How old deps #255
Changes from all commits
9509388
ca9f309
4483c3e
9918e5f
786b183
9d6c49f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -91,13 +91,13 @@ type Result_6 = | |||||||
err: Err; | ||||||||
ok: vec record { | ||||||||
PackageName; | ||||||||
PackageVersion; | ||||||||
PackageVersion__1; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Incomplete Renaming of Multiple instances of
Please ensure all occurrences are renamed to 🔗 Analysis chainLGTM. Verify consistency across the codebase. The change from To ensure all occurrences have been updated, run the following command: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any remaining instances of PackageVersion (without __1)
rg --type candid 'PackageVersion(?!__1)' .
Length of output: 372 Script: #!/bin/bash
# Search for any instances of PackageVersion not followed by __1
rg --type candid 'PackageVersion' . | grep -v 'PackageVersion__1'
Length of output: 94 Script: #!/bin/bash
# Search for any instances of PackageVersion not followed by __1 in .did files
rg 'PackageVersion' --glob '*.did' . | grep -v 'PackageVersion__1'
Length of output: 896 |
||||||||
}; | ||||||||
}; | ||||||||
type Result_5 = | ||||||||
variant { | ||||||||
err: Err; | ||||||||
ok: PackageVersion; | ||||||||
ok: PackageVersion__1; | ||||||||
}; | ||||||||
type Result_4 = | ||||||||
variant { | ||||||||
|
@@ -147,6 +147,7 @@ type Request = | |||||||
}; | ||||||||
type PublishingId = text; | ||||||||
type PageCount = nat; | ||||||||
type PackageVersion__1 = text; | ||||||||
type PackageVersion = text; | ||||||||
Comment on lines
+150
to
151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider removing the original While the addition of Consider applying this change: type PackageVersion__1 = text;
-type PackageVersion = text; This will help maintain consistency with the renaming strategy and prevent potential confusion or errors in the future. 📝 Committable suggestion
Suggested change
|
||||||||
type PackageSummary__1 = | ||||||||
record { | ||||||||
|
@@ -155,6 +156,7 @@ type PackageSummary__1 = | |||||||
downloadsInLast30Days: nat; | ||||||||
downloadsInLast7Days: nat; | ||||||||
downloadsTotal: nat; | ||||||||
highestVersion: PackageVersion; | ||||||||
ZenVoich marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
owner: principal; | ||||||||
ownerInfo: User; | ||||||||
publication: PackagePublication; | ||||||||
|
@@ -168,6 +170,7 @@ type PackageSummaryWithChanges__1 = | |||||||
downloadsInLast30Days: nat; | ||||||||
downloadsInLast7Days: nat; | ||||||||
downloadsTotal: nat; | ||||||||
highestVersion: PackageVersion; | ||||||||
owner: principal; | ||||||||
ownerInfo: User; | ||||||||
publication: PackagePublication; | ||||||||
|
@@ -181,6 +184,7 @@ type PackageSummaryWithChanges = | |||||||
downloadsInLast30Days: nat; | ||||||||
downloadsInLast7Days: nat; | ||||||||
downloadsTotal: nat; | ||||||||
highestVersion: PackageVersion; | ||||||||
owner: principal; | ||||||||
ownerInfo: User; | ||||||||
publication: PackagePublication; | ||||||||
|
@@ -193,6 +197,7 @@ type PackageSummary = | |||||||
downloadsInLast30Days: nat; | ||||||||
downloadsInLast7Days: nat; | ||||||||
downloadsTotal: nat; | ||||||||
highestVersion: PackageVersion; | ||||||||
owner: principal; | ||||||||
ownerInfo: User; | ||||||||
publication: PackagePublication; | ||||||||
|
@@ -237,6 +242,7 @@ type PackageDetails = | |||||||
downloadsInLast7Days: nat; | ||||||||
downloadsTotal: nat; | ||||||||
fileStats: PackageFileStatsPublic; | ||||||||
highestVersion: PackageVersion; | ||||||||
ZenVoich marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
owner: principal; | ||||||||
ownerInfo: User; | ||||||||
publication: PackagePublication; | ||||||||
|
@@ -303,13 +309,13 @@ type Main = | |||||||
getDefaultPackages: (text) -> | ||||||||
(vec record { | ||||||||
PackageName; | ||||||||
PackageVersion; | ||||||||
PackageVersion__1; | ||||||||
}) query; | ||||||||
getDownloadTrendByPackageId: (PackageId) -> | ||||||||
(vec DownloadsSnapshot__1) query; | ||||||||
getDownloadTrendByPackageName: (PackageName) -> | ||||||||
(vec DownloadsSnapshot__1) query; | ||||||||
getFileHashes: (PackageName, PackageVersion) -> (Result_8); | ||||||||
getFileHashes: (PackageName, PackageVersion__1) -> (Result_8); | ||||||||
getFileHashesByPackageIds: (vec PackageId) -> | ||||||||
(vec record { | ||||||||
PackageId; | ||||||||
|
@@ -318,19 +324,19 @@ type Main = | |||||||
blob; | ||||||||
}; | ||||||||
}); | ||||||||
getFileHashesQuery: (PackageName, PackageVersion) -> (Result_8) query; | ||||||||
getFileIds: (PackageName, PackageVersion) -> (Result_7) query; | ||||||||
getFileHashesQuery: (PackageName, PackageVersion__1) -> (Result_8) query; | ||||||||
getFileIds: (PackageName, PackageVersion__1) -> (Result_7) query; | ||||||||
getHighestSemverBatch: | ||||||||
(vec record { | ||||||||
PackageName; | ||||||||
PackageVersion; | ||||||||
PackageVersion__1; | ||||||||
SemverPart; | ||||||||
}) -> (Result_6) query; | ||||||||
getHighestVersion: (PackageName) -> (Result_5) query; | ||||||||
getMostDownloadedPackages: () -> (vec PackageSummary) query; | ||||||||
getMostDownloadedPackagesIn7Days: () -> (vec PackageSummary) query; | ||||||||
getNewPackages: () -> (vec PackageSummary) query; | ||||||||
getPackageDetails: (PackageName, PackageVersion) -> (Result_4) query; | ||||||||
getPackageDetails: (PackageName, PackageVersion__1) -> (Result_4) query; | ||||||||
getPackagesByCategory: () -> (vec record { | ||||||||
text; | ||||||||
vec PackageSummary; | ||||||||
|
@@ -344,10 +350,10 @@ type Main = | |||||||
getTotalPackages: () -> (nat) query; | ||||||||
getUser: (principal) -> (opt User__1) query; | ||||||||
http_request: (Request) -> (Response) query; | ||||||||
notifyInstall: (PackageName, PackageVersion) -> () oneway; | ||||||||
notifyInstall: (PackageName, PackageVersion__1) -> () oneway; | ||||||||
notifyInstalls: (vec record { | ||||||||
PackageName; | ||||||||
PackageVersion; | ||||||||
PackageVersion__1; | ||||||||
}) -> () oneway; | ||||||||
restore: (nat) -> (); | ||||||||
search: (Text, opt nat, opt nat) -> (vec PackageSummary, PageCount) query; | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,7 @@ export interface Main { | |
'getBackupCanisterId' : ActorMethod<[], Principal>, | ||
'getDefaultPackages' : ActorMethod< | ||
[string], | ||
Array<[PackageName, PackageVersion]> | ||
Array<[PackageName, PackageVersion__1]> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent use of 'PackageVersion' and 'PackageVersion__1' The code introduces Affected lines:
Recommendation: If // Example of updating types for consistency:
- export type PackageVersion = string;
+ // export type PackageVersion = string; (if deprecated)
- export type PackageVersion__1 = string;
+ export type PackageVersion = string;
// Update method signatures accordingly:
- 'getDefaultPackages' : ActorMethod<[string], Array<[PackageName, PackageVersion__1]>>,
+ 'getDefaultPackages' : ActorMethod<[string], Array<[PackageName, PackageVersion]>>, Also applies to: 76-76, 81-84, 85-85, 87-87, 94-94, 108-108, 110-112, 302-302, 304-304 |
||
>, | ||
'getDownloadTrendByPackageId' : ActorMethod< | ||
[PackageId], | ||
|
@@ -73,22 +73,25 @@ export interface Main { | |
[PackageName], | ||
Array<DownloadsSnapshot__1> | ||
>, | ||
'getFileHashes' : ActorMethod<[PackageName, PackageVersion], Result_8>, | ||
'getFileHashes' : ActorMethod<[PackageName, PackageVersion__1], Result_8>, | ||
'getFileHashesByPackageIds' : ActorMethod< | ||
[Array<PackageId>], | ||
Array<[PackageId, Array<[FileId, Uint8Array | number[]]>]> | ||
>, | ||
'getFileHashesQuery' : ActorMethod<[PackageName, PackageVersion], Result_8>, | ||
'getFileIds' : ActorMethod<[PackageName, PackageVersion], Result_7>, | ||
'getFileHashesQuery' : ActorMethod< | ||
[PackageName, PackageVersion__1], | ||
Result_8 | ||
>, | ||
'getFileIds' : ActorMethod<[PackageName, PackageVersion__1], Result_7>, | ||
'getHighestSemverBatch' : ActorMethod< | ||
[Array<[PackageName, PackageVersion, SemverPart]>], | ||
[Array<[PackageName, PackageVersion__1, SemverPart]>], | ||
Result_6 | ||
>, | ||
'getHighestVersion' : ActorMethod<[PackageName], Result_5>, | ||
'getMostDownloadedPackages' : ActorMethod<[], Array<PackageSummary>>, | ||
'getMostDownloadedPackagesIn7Days' : ActorMethod<[], Array<PackageSummary>>, | ||
'getNewPackages' : ActorMethod<[], Array<PackageSummary>>, | ||
'getPackageDetails' : ActorMethod<[PackageName, PackageVersion], Result_4>, | ||
'getPackageDetails' : ActorMethod<[PackageName, PackageVersion__1], Result_4>, | ||
'getPackagesByCategory' : ActorMethod< | ||
[], | ||
Array<[string, Array<PackageSummary>]> | ||
|
@@ -102,9 +105,9 @@ export interface Main { | |
'getTotalPackages' : ActorMethod<[], bigint>, | ||
'getUser' : ActorMethod<[Principal], [] | [User__1]>, | ||
'http_request' : ActorMethod<[Request], Response>, | ||
'notifyInstall' : ActorMethod<[PackageName, PackageVersion], undefined>, | ||
'notifyInstall' : ActorMethod<[PackageName, PackageVersion__1], undefined>, | ||
'notifyInstalls' : ActorMethod< | ||
[Array<[PackageName, PackageVersion]>], | ||
[Array<[PackageName, PackageVersion__1]>], | ||
undefined | ||
>, | ||
'restore' : ActorMethod<[bigint], undefined>, | ||
|
@@ -182,6 +185,7 @@ export interface PackageDetails { | |
'deps' : Array<PackageSummary__1>, | ||
'quality' : PackageQuality, | ||
'testStats' : TestStats__1, | ||
'highestVersion' : PackageVersion, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type mismatch in 'highestVersion' field across interfaces The Affected interfaces:
Recommendation: Align the type of the // Example of updating the 'highestVersion' field:
- 'highestVersion' : PackageVersion,
+ 'highestVersion' : PackageVersion__1, Also applies to: 228-228, 240-240, 253-253, 266-266 |
||
'downloadsTotal' : bigint, | ||
'downloadsInLast30Days' : bigint, | ||
'downloadTrend' : Array<DownloadsSnapshot>, | ||
|
@@ -221,6 +225,7 @@ export interface PackageSummary { | |
'owner' : Principal, | ||
'depAlias' : string, | ||
'quality' : PackageQuality, | ||
'highestVersion' : PackageVersion, | ||
'downloadsTotal' : bigint, | ||
'downloadsInLast30Days' : bigint, | ||
'downloadsInLast7Days' : bigint, | ||
|
@@ -232,6 +237,7 @@ export interface PackageSummaryWithChanges { | |
'owner' : Principal, | ||
'depAlias' : string, | ||
'quality' : PackageQuality, | ||
'highestVersion' : PackageVersion, | ||
'downloadsTotal' : bigint, | ||
'downloadsInLast30Days' : bigint, | ||
'downloadsInLast7Days' : bigint, | ||
|
@@ -244,6 +250,7 @@ export interface PackageSummaryWithChanges__1 { | |
'owner' : Principal, | ||
'depAlias' : string, | ||
'quality' : PackageQuality, | ||
'highestVersion' : PackageVersion, | ||
'downloadsTotal' : bigint, | ||
'downloadsInLast30Days' : bigint, | ||
'downloadsInLast7Days' : bigint, | ||
|
@@ -256,13 +263,15 @@ export interface PackageSummary__1 { | |
'owner' : Principal, | ||
'depAlias' : string, | ||
'quality' : PackageQuality, | ||
'highestVersion' : PackageVersion, | ||
'downloadsTotal' : bigint, | ||
'downloadsInLast30Days' : bigint, | ||
'downloadsInLast7Days' : bigint, | ||
'config' : PackageConfigV3, | ||
'publication' : PackagePublication, | ||
} | ||
export type PackageVersion = string; | ||
export type PackageVersion__1 = string; | ||
export type PageCount = bigint; | ||
export type PublishingId = string; | ||
export interface Request { | ||
|
@@ -290,9 +299,9 @@ export type Result_3 = { 'ok' : FileId } | | |
{ 'err' : Err }; | ||
export type Result_4 = { 'ok' : PackageDetails } | | ||
{ 'err' : Err }; | ||
export type Result_5 = { 'ok' : PackageVersion } | | ||
export type Result_5 = { 'ok' : PackageVersion__1 } | | ||
{ 'err' : Err }; | ||
export type Result_6 = { 'ok' : Array<[PackageName, PackageVersion]> } | | ||
export type Result_6 = { 'ok' : Array<[PackageName, PackageVersion__1]> } | | ||
{ 'err' : Err }; | ||
export type Result_7 = { 'ok' : Array<FileId> } | | ||
{ 'err' : Err }; | ||
|
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.
Consider adding error handling for
getHighestVersion
The use of the
!
operator assumes thatregistry.getHighestVersion(name)
will always return a value. This might lead to runtime errors if the highest version cannot be retrieved for any reason.Consider using pattern matching or the
do?
syntax to handle potentialnull
values more gracefully. For example:This approach ensures that the function returns
null
if the highest version cannot be retrieved, maintaining consistency with the function's return type of?PackageSummary
.📝 Committable suggestion