feat: repo health check (#16) #17

Merged
张泊明518370910136 merged 37 commits from file_check into master 2024-09-11 20:09:27 +08:00
Showing only changes of commit 9cdc381e06 - Show all commits

View File

@ -44,8 +44,8 @@ func main() {
droneBranch := flag.String("droneBranch", "", "")
releaseCategories := flag.String("releaseCategories", "", "")
releaseNumber := flag.Int("releaseNumber", 0, "")
// FIXME: for drone usage
adminDir := flag.String("admin", "", "") // adminDir is for config files
checkFileNameList := flag.String("checkFileNameList", "", "Comma-separated list of files to check.")
checkFileSumList := flag.String("checkFileSumList", "", "Comma-separated list of expected checksums.")
parseMultiValueFlag(&gitWhitelist, "whitelist", "")
parseMultiValueFlag(&metaFile, "meta", "")
parseMultiValueFlag(&releaseTags, "releaseTags", "")
@ -72,16 +72,14 @@ func main() {
if err != nil {
fmt.Printf("## Non-ASCII Characters Commit Message Check Failed:\n%s\n", err.Error())
}
// TODO: find a way to test the release tag
err = healthcheck.CheckTags(*rootDir, *releaseCategories, *releaseNumber)
bomingzh marked this conversation as resolved Outdated

check releases need to use Gitea API, just check tags is enough

check releases need to use Gitea API, just check tags is enough

Yep, only check tags

Yep, only check tags

Where is it tested?

Where is it tested?
if err != nil {
fmt.Printf("## Release Tag Check Failed:\n%s\n", err.Error())
}
// FIXME: for drone usage
if adminDir != nil && *adminDir != "" {
err = healthcheck.VerifyDirectory(*rootDir, *adminDir)
err = healthcheck.VerifyFiles(*rootDir, *checkFileNameList, *checkFileSumList)
zzjc123 marked this conversation as resolved Outdated

what should be fixed?

what should be fixed?

I think it is due to we can only test it when it is deployed on drone so I just skip it when running the code. If not I couldn't push the code.

I think it is due to we can only test it when it is deployed on drone so I just skip it when running the code. If not I couldn't push the code.

I think checking an empty value for skipping it is enough. No dir specified = no verify.

I think checking an empty value for skipping it is enough. No dir specified = no verify.
if err != nil {
fmt.Printf("## Directory File Check Failed:\n%s\n", err.Error())
}
fmt.Printf("## Repo File Check Failed:\n%s\n", err.Error())
}
}