[#68] Fix pre-commit issues #68

Merged
alexvanin merged 1 commit from dkirillov/frostfs-s3-gw:feature/fix-pre-commit_issues into master 2023-03-27 06:52:54 +00:00
21 changed files with 345 additions and 360 deletions

1
.gitignore vendored
View file

@ -28,4 +28,3 @@ debian/files
debian/*.log
debian/*.substvars
debian/frostfs-s3-gw/

View file

@ -753,12 +753,3 @@ func periodicXMLWriter(w io.Writer, dur time.Duration) (stop func() bool) {
return stop
}
// periodicWriterErrorSender returns handler function to send error. If header is
// alreay written by periodic XML writer, do not send HTTP and XML headers.
func (h *handler) periodicWriterErrorSender(headerWritten bool) func(http.ResponseWriter, string, *api.ReqInfo, error, ...zap.Field) {
Review

Oups.

Oups.
if headerWritten {
return h.logAndSendErrorNoHeader
}
return h.logAndSendError
}

View file

@ -27,4 +27,3 @@ message Tokens {
bytes bearerToken = 2 [json_name = "bearerToken"];
repeated bytes sessionTokens = 3 [json_name = "sessionTokens"];
}

6
debian/frostfs-s3-gw.postinst vendored Normal file → Executable file
View file

@ -29,9 +29,9 @@ case "$1" in
chmod -f 0640 /etc/frostfs/$USERNAME/config.yaml || true
fi
USERDIR=$(getent passwd "frostfs-$USERNAME" | cut -d: -f6)
if ! dpkg-statoverride --list frostfs-$USERDIR >/dev/null; then
chown -f frostfs-$USERNAME: $USERDIR
chown -f frostfs-$USERNAME: $USERDIR/rules.json
if ! dpkg-statoverride --list frostfs-"$USERDIR" >/dev/null; then
chown -f frostfs-$USERNAME: "$USERDIR"
chown -f frostfs-$USERNAME: "$USERDIR"/rules.json
fi
;;

0
debian/frostfs-s3-gw.postrm vendored Normal file → Executable file
View file

0
debian/frostfs-s3-gw.preinst vendored Normal file → Executable file
View file

0
debian/frostfs-s3-gw.prerm vendored Normal file → Executable file
View file

2
debian/rules vendored
View file

@ -12,5 +12,3 @@ override_dh_installsystemd:
override_dh_installchangelogs:
dh_installchangelogs -k CHANGELOG.md

View file

@ -78,7 +78,7 @@ Compatibility: 30/25/29 out of 33
Compatibility: 33/43/37 out of 64
| | Test | s3-gw | minio | aws s3 |
Review

I wonder if updating script is going to be okay with this change.
Anyway we need to update it with new s3-tests based on pytest and tox.

I wonder if updating script is going to be okay with this change. Anyway we need to update it with new s3-tests based on pytest and tox.
Review

I wonder if updating script is going to be okay with this change.

I have checked it and it seems everything ok

> I wonder if updating script is going to be okay with this change. I have checked it and it seems everything ok
|----|------------------------------------------------------------------------------------------------|-------------|-------|--------|
|-----|------------------------------------------------------------------------------------------------|-------------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_put_object_ifmatch_good | ok | ok | ERROR |
| 2 | s3tests_boto3.functional.test_s3.test_put_object_ifmatch_failed | FAIL | FAIL | FAIL |
| 3 | s3tests_boto3.functional.test_s3.test_put_object_ifmatch_overwrite_existed_good | ok | ok | ERROR |
@ -343,7 +343,7 @@ Compatibility: 4/5/29 out of 29
Compatibility: 19/15/19 out of 22
| | Test | s3-gw | minio | aws s3 |
|----|----------------------------------------------------------------------------------|-------|-------|--------|
|-----|----------------------------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_multipart_upload_empty | ok | FAIL | FAIL |
| 2 | s3tests_boto3.functional.test_s3.test_multipart_upload_small | ERROR | ERROR | ok |
| 3 | s3tests_boto3.functional.test_s3.test_multipart_copy_small | ok | ok | ok |
@ -374,7 +374,7 @@ Comments: in [PR](https://github.com/nspcc-dev/s3-tests/pull/5)
Compatibility: 9/6/8 out of 11
| | Test | s3-gw | minio | aws s3 |
|----|------------------------------------------------------------|-------|-------|--------|
|-----|------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_set_bucket_tagging | FAIL | FAIL | FAIL |
| 2 | s3tests_boto3.functional.test_s3.test_get_obj_tagging | ok | ok | ok |
| 3 | s3tests_boto3.functional.test_s3.test_get_obj_head_tagging | ok | ok | ok |
@ -392,7 +392,7 @@ Compatibility: 9/6/8 out of 11
Compatibility: 23/19/24 out of 26
| | Test | s3-gw | minio | aws s3 |
|----|---------------------------------------------------------------------------------------------|-------|-------|--------|
|-----|---------------------------------------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_versioning_bucket_create_suspend | ok | ok | ok |
| 2 | s3tests_boto3.functional.test_s3.test_versioning_obj_create_read_remove | ok | ok | ok |
| 3 | s3tests_boto3.functional.test_s3.test_versioning_obj_create_read_remove_head | ok | ok | ok |
@ -425,7 +425,7 @@ Compatibility: 23/19/24 out of 26
Compatibility: 38/38/45 out of 59
| | Test | s3-gw | minio | aws s3 |
|----|----------------------------------------------------------------------------------------------|-------|-------|--------|
|-----|----------------------------------------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_headers.test_bucket_create_bad_authorization_invalid_aws2 | FAIL | FAIL | FAIL |
| 2 | s3tests_boto3.functional.test_headers.test_bucket_create_bad_ua_empty_aws2 | ERROR | ok | ok |
| 3 | s3tests_boto3.functional.test_headers.test_bucket_create_bad_ua_none_aws2 | ERROR | ok | ok |
@ -582,7 +582,7 @@ Compatibility: 0/10/18 out of 29
This group is not explicitly supported by s3-gw, but some tests may pass.
| | Test | s3-gw | minio | aws s3 |
|----|---------------------------------------------------------------------------------|-------|-------|--------|
|-----|---------------------------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_lifecycle_set | ERROR | ok | ok |
| 2 | s3tests_boto3.functional.test_s3.test_lifecycle_get | ERROR | FAIL | ok |
| 3 | s3tests_boto3.functional.test_s3.test_lifecycle_get_no_id | ERROR | ERROR | ok |
@ -619,7 +619,7 @@ Compatibility: 0/7/20 out of 35
This group is not explicitly supported by s3-gw, but some tests may pass.
| | Test | s3-gw | minio | aws s3 |
|----|-------------------------------------------------------------------------------------|-------|-------|--------|
|-----|-------------------------------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_bucket_policy | ERROR | ok | ok |
| 2 | s3tests_boto3.functional.test_s3.test_bucketv2_policy | ERROR | ok | ok |
| 3 | s3tests_boto3.functional.test_s3.test_bucket_policy_acl | ERROR | ERROR | ok |
@ -661,7 +661,7 @@ This group is not explicitly supported by s3-gw, but some tests may pass.
Compatibility: 2/2/3 out of 6
| | Test | s3-gw | minio | aws s3 |
|---|-------------------------------------------------------------|-------|-------|--------|
|-----|-------------------------------------------------------------|-------|-------|--------|
| 1 | s3tests_boto3.functional.test_s3.test_100_continue | FAIL | ERROR | ok |
| 2 | s3tests_boto3.functional.test_s3.test_account_usage | ERROR | ERROR | ERROR |
| 3 | s3tests_boto3.functional.test_s3.test_head_bucket_usage | ERROR | ERROR | ERROR |

View file

@ -23,13 +23,11 @@ get_adjusted_result () {
printf "%s%*s" "$NEW_RESULT" $ADDITIONAL_SPACES ''
}
while read -r line;
do
while read -r line; do
RES_LINE=$(echo "$line" | sed -nE '/^s3tests_boto3/p')
if [ -n "$RES_LINE" ]
then
TEST=$(echo "$RES_LINE" | sed -e 's/[[:space:]]*\.\.\..*//')
RESULT=$(echo "$RES_LINE" | sed -e 's/^.*\.\.\.[[:space:]]*//')
if [ -n "$RES_LINE" ]; then
TEST=${RES_LINE%%[[:space:]]*}
RESULT=${RES_LINE##*[[:space:]]}
# beautify trailing spaces
OLD_RESULT_S3GW=$(sed -n "s/^.*${TEST}[[:space:]]*|[[:space:]]\(.*\)[[:space:]]|.*|.*|$/\1/p" "$RESULT_FILE" | head -1)