repo health executable & parser #16

Closed
opened 2024-03-07 10:10:21 +08:00 by manuel · 8 comments
Owner

previous implementation:

  • check repo size
  • ensure checksum of basic files in unchanged (eg. .drone.yml, .gitattributes, .gitignore)
  • ensure no forbidden files was pushed
  • ensure existence of "must have files" (eg. changelog, readme)
  • ensure ascii files only have been pushed
  • ensure commit messages don't use non-ascii characters
  • fail on any issue and return an error (with hints to fix the problem)
previous implementation: - check repo size - ensure checksum of basic files in unchanged (eg. `.drone.yml, .gitattributes, .gitignore`) - ensure no forbidden files was pushed - ensure existence of "must have files" (eg. changelog, readme) - ensure ascii files only have been pushed - ensure commit messages don't use non-ascii characters - fail on any issue and return an error (with hints to fix the problem)
manuel added the
component
UI
label 2024-03-07 10:10:21 +08:00
Author
Owner

changes to .drone.yml can be prevented at drone level by enabling protected option
eg.

 curl -s -X PATCH "$DRONEURL/org/repo" -H "Authorization: Bearer $DTOKEN" -H 'Content-Type: application/json' -d "{\"protected\": true}"

main benefit is that drone blocks any further action until "manually" enabled \to a daily api call could cancel/reject all requests (to prevent drone page to display "pending tasks")

changes to `.drone.yml` can be prevented at drone level by enabling protected option eg. ``` curl -s -X PATCH "$DRONEURL/org/repo" -H "Authorization: Bearer $DTOKEN" -H 'Content-Type: application/json' -d "{\"protected\": true}" ``` main benefit is that drone blocks any further action until "manually" enabled $\to$ a daily api call could cancel/reject all requests (to prevent drone page to display "pending tasks")
Author
Owner

@all for that part of the code what language would be best?

the current bash implementation does the job quite well with no major drawback or corner case. is it worth the effort to reimplement in go or python? eg. file encoding, file length, existence of forbidden files and missing basic ones, etc.

@all for that part of the code what language would be best? the current bash implementation does the job quite well with no major drawback or corner case. is it worth the effort to reimplement in go or python? eg. file encoding, file length, existence of forbidden files and missing basic ones, etc.

i think reimplementing in go would be a good start for us (

i think reimplementing in go would be a good start for us (

for ascii we can use this package or use code here

for ascii we can use this [package](https://pkg.go.dev/golang.org/x/exp/utf8string#String.IsASCII) or use code [here](https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters)

Possibly reimplement in go might improve the consistency of the config file?

Possibly reimplement in go might improve the consistency of the config file?
Author
Owner

Possibly reimplement in go might improve the consistency of the config file?

would not be hard to read toml with shell script

overall no special preference on my side. with it a go with go :-D

> Possibly reimplement in go might improve the consistency of the config file? would not be hard to read toml with shell script overall no special preference on my side. with it a go with go :-D
张泊明518370910136 added a new dependency 2024-03-23 03:32:28 +08:00
Author
Owner

parsing the commit message: ensure "patched" conventional commits are used (FOCS-dev/JOJ3#14 (comment))

parsing the commit message: ensure "patched" conventional commits are used (https://focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/issues/14#issuecomment-296224)
张泊明518370910136 added
component
parser
and removed
component
UI
labels 2024-04-01 04:38:37 +08:00
张泊明518370910136 added the
priority
p2
label 2024-04-01 04:43:56 +08:00
张泊明518370910136 changed title from repo health to repo health executable & parser 2024-04-01 04:45:03 +08:00
张泊明518370910136 added
priority
p1
and removed
priority
p2
labels 2024-04-01 05:59:56 +08:00
Author
Owner
go-git library status https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md
Sign in to join this conversation.
No description provided.