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

Fixups for 2023-11-03 SDK #101

Merged
merged 2 commits into from
Feb 8, 2024
Merged

Fixups for 2023-11-03 SDK #101

merged 2 commits into from
Feb 8, 2024

Conversation

manicminer
Copy link
Collaborator

@manicminer manicminer commented Feb 6, 2024

  • HttpResponse fields to be vanilla *http.Response
  • Embed all response structs for continuity
  • General tidy up, remove shadowed vars, improve error handling
  • Fix a typo'd struct tag in both SDK versions
  • Export GetPropertiesInput{}.Action in storage/2023-11-03/datalakestore/paths/properties_get.go

- `HttpResponse` fields to be vanilla `*http.Response`
- Embed all response structs for continuity
- General tidy up, remove shadowed vars, improve error handling
Copy link
Collaborator

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

Thanks @manicminer - I spotted a few things we could fix up but mostly this looks good to me 👍

Comment on lines 88 to 90
// TODO commenting these out to see if they're really needed (net/http should do this) (@manicminer)
//req.Body = io.NopCloser(bytes.NewReader(input.Content))
//req.ContentLength = int64(len(input.Content))
Copy link
Collaborator

Choose a reason for hiding this comment

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

these might be required, I'm seeing this error when running the tests now:

Error putting page: executing request: unexpected status 403 with response: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it seems so. There's probably an underlying fix to be made somewhere but this will do as a workaround for now :)

@@ -3,13 +3,13 @@ package blobs
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this import has gotten out of order

}

if v := resp.HttpResponse.Header.Get("Content-Length"); v != "" {
if v := resp.Header.Get("Content-Length"); v != "" {
i, innerErr := strconv.Atoi(v)
if innerErr != nil {
err = fmt.Errorf("error parsing %q as an integer: %s", v, innerErr)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we update these errors too to mention which header it is for consistency?

@@ -3,13 +3,13 @@ package blobs
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

import here needs sorted

@@ -3,14 +3,13 @@ package filesystems
import (
"context"
"fmt"
"github.com/hashicorp/go-azure-sdk/sdk/client"
Copy link
Collaborator

Choose a reason for hiding this comment

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

imports need sorted here

@@ -3,32 +3,35 @@ package files
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

imports need sorted here

@@ -3,16 +3,16 @@ package files
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

imports need sorting here

@@ -3,16 +3,16 @@ package shares
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

imports need sorted here

@@ -3,16 +3,16 @@ package shares
import (
"context"
"fmt"
"github.com/tombuildsstuff/giovanni/storage/internal/metadata"
Copy link
Collaborator

Choose a reason for hiding this comment

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

imports need sorted here

@manicminer
Copy link
Collaborator Author

Thanks @catriona-m! I've fixed up those and re-added the Content-Length workaround in the blobs client if you could take another look?

Copy link
Collaborator

@catriona-m catriona-m left a comment

Choose a reason for hiding this comment

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

LGTM 😄 👍

@manicminer manicminer merged commit 4544cfc into main Feb 8, 2024
1 check passed
@manicminer manicminer deleted the fixups-for-2023-11-03 branch February 8, 2024 11:32
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.

2 participants