fix/forbidden (#58) #60
No reviewers
Labels
No Label
bug
component
executor
component
framework
component
parser
component
UI
duplicate
enhancement
help wanted
invalid
priority
p0
priority
p1
priority
p2
priority
p3
question
wontfix
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JOJ/JOJ3#60
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/forbidden"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
.
#58
should fix issue in https://focs.ji.sjtu.edu.cn/git/engr151-24fa/hteam-05
Non-ASCII Characters File Check Failed:
Non-ASCII characters found in the following files:
h2/README.md
@ -18,2 +18,2 @@
var regexList []*regexp.Regexp
regexList, err := getRegex(fileList)
// Create a gitignore instance from the .gitignore file
ignore, err := gitignore.NewFromFile(filepath.Join(root, ".gitignore"))
.gitignore
file.gitignore
file may appear in sub-dirs, you also need to check themSo what's the default pattern if no gitignore? Warn student add a gitignore or set root as default value?
what if the gitignore is nonsense? Not every course provide unchangeable gitignore
Change to locallist and make it work as a gitignore file?
with JOJ3 they must have an immutable gitignore or the server will quickly become a massive mess... caught a student who wanted to see what happened if he pushd a movie... repo was 2.8GB :/
If the forbidden check is enabled, then just throw error for no root gitignore or wrong root gitignore.
WIP: fix/forbiddento WIP: fix/forbidden (#58)Also, add an option to healthcheck parser for stdout and stderr as we need to put them to
/tmp/stdout
and/tmp/stderr
.not sure what did you mean, can you explain more detailedly?
ignore the /w/tmp/?
Now the hc parser is hardcoded to read stdout from file
./stdout
and stderr from file./stderr
. But with this check, they can not be hardcoded, make them a config option.stdout := executorResult.Files["stdout"]
=>stdout := executorResult.Files[conf.Stdout]
may need some time for this feature. A little busy recently.
may be done this weekend
seems easier than i think @bomingzh plz check it. i don't sure is this function correctly implemented in package.
new test cases needed
add a simple case here but I'm afraid that it is too simple. https://focs.ji.sjtu.edu.cn/git/JOJ/JOJ3-examples/src/branch/healthcheck/forbiddenfile
can anyone think about some more tricky cases.
.DB_Store
in a subdirin 100 we need students to list their "allowed files" in a file (not strict pattern can be defined). so they use a file (
messenger.json
, which should be configured in repo level toml) to list their "self-allowed" files.@manuel like this?
output of
hc
❯ ../JOJ3/build/healthcheck -root=.
Forbidden File Check Failed:
The following forbidden files were found:
conf.json
,expected.json
,test/.DS_Store
,test1
,test1/test.md
To fix it, first make a backup of your repository and then run the following commands:
.gitignore in root
test1/.gitignore
file tree
what if you add
test1/test2/test.c
?do we need to have a gitignore in each in each folder?
fix tests
what do you mean? not sure about it
.c file should be ignored or included by which gitignore?
create a new pr for it?
WIP: fix/forbidden (#58)to fix/forbidden (#58)yes, new pr
suppose you have
.gitignore
at repo root,test1
dir is allowed and can contain*.c
. what is happening if you createtest1/test2/test.c
?in your example you have a
.gitgnore
containing!*.json
(in test or test1 if i recall well). were you testing what is happening for a.gitignore
in a subdir or this is because we should now have 1gitignore
per dir?so you want to test whether the subdir of a subdir containing .gitignore follow the rule in the subdir?