Skip to content
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

Improvement/arsn 422 support post object #2248

Open
wants to merge 7 commits into
base: development/7.70
Choose a base branch
from

Conversation

KazToozs
Copy link
Contributor

@KazToozs KazToozs commented Jul 1, 2024

Adds support for postObject API by adding the route and updating one of the relevant errors that will be handled in the first PR here

@bert-e
Copy link
Contributor

bert-e commented Jul 1, 2024

Hello kaztoozs,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch from 8bfbebb to 1016c27 Compare July 1, 2024 20:00
@KazToozs KazToozs marked this pull request as ready for review July 2, 2024 08:34
@bert-e
Copy link
Contributor

bert-e commented Jul 2, 2024

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@scality scality deleted a comment from bert-e Jul 4, 2024
@@ -58,6 +58,10 @@ export default function routePOST(
corsHeaders));
}

if (objectKey === undefined && Object.keys(query).length === 0) {
return api.callApiMethod('objectPost', request, response, log, (err, resHeaders) => routesUtils.responseNoBody(err, resHeaders, response, 204, log));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this crash if err is not one of our error with a code, example of error sent:

Error: Unexpected end of multipart data
    at /home/mickael/scality/cloudserver/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:54:28

Producing this crash:

RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined
    at new NodeError (node:internal/errors:387:5)
    at ServerResponse.writeHead (node:_http_server:314:11)
    at Object.errorXMLResponse [as errorResponse] (/home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routesUtils.js:142:18)
    at Object.responseNoBody (/home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routesUtils.js:432:35)
    at /home/mickael/scality/cloudserver/node_modules/arsenal/build/lib/s3routes/routes/routePOST.js:62:105
    at /home/mickael/scality/cloudserver/lib/api/api.js:317:24
    at /home/mickael/scality/cloudserver/node_modules/async/dist/async.js:421:16
    at next (/home/mickael/scality/cloudserver/node_modules/async/dist/async.js:5302:29)
    at /home/mickael/scality/cloudserver/node_modules/async/dist/async.js:906:16
    at Busboy.<anonymous> (/home/mickael/scality/cloudserver/lib/api/api.js:238:32)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed in the most recent updates I made, please re-open if you see otherwise

@@ -58,6 +58,10 @@ export default function routePOST(
corsHeaders));
}

if (objectKey === undefined && Object.keys(query).length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also on post object aws returns a 400 instead of a 501 Not Implemented for query string

    <Code>InvalidArgument</Code>
    <Message>Query String Parameters not allowed on POST requests.</Message>

Copy link
Contributor Author

@KazToozs KazToozs Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also before that if there is an objectKey and no query string match the previous conditions, aws returns 405 Method Not Allowed instead of 501 Not Implemented

    <Code>MethodNotAllowed</Code>
    <Message>The specified method is not allowed against this resource.</Message>
    <Method>POST</Method>
    <ResourceType>OBJECT</ResourceType>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch 2 times, most recently from b09b46e to 1016c27 Compare July 10, 2024 16:33
@bert-e
Copy link
Contributor

bert-e commented Jul 11, 2024

Incorrect fix version

The Fix Version/s in issue ARSN-422 contains:

  • 7.70.33

  • 8.1.132

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 7.70.33

  • 8.1.133

Please check the Fix Version/s of ARSN-422, or the target
branch of this pull request.

@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch from c85360c to d8fc234 Compare July 11, 2024 10:15
@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch from 573e0ed to 03db00b Compare July 16, 2024 14:01
@bert-e
Copy link
Contributor

bert-e commented Jul 16, 2024

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch from 03db00b to 61984fb Compare July 16, 2024 15:02
@@ -247,7 +247,7 @@ export const InvalidURI: ErrorFormat = {
description: "Couldn't parse the specified URI.",
};

export const KeyTooLong: ErrorFormat = {
export const KeyTooLongError: ErrorFormat = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll work with the old version for CS Post Object then

@KazToozs KazToozs force-pushed the improvement/ARSN-422-support-post-object branch from 1f44698 to 4ef5748 Compare July 18, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants