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

Add PublicKey field to S3 all CRUD actions #198

Merged
merged 2 commits into from
Jun 3, 2020
Merged

Add PublicKey field to S3 all CRUD actions #198

merged 2 commits into from
Jun 3, 2020

Conversation

mccurdyc
Copy link
Contributor

@mccurdyc mccurdyc commented Jun 3, 2020

Proposed Change(s)

  • Add missing PublicKey field to Creates and Updates and responses.
  • Update integration test mock recordings for S3.

Relevant Link(s) / Documentation

Validation

$ export FASTLY_TEST_SERVICE_ID=<foo>; \
export FASTLY_API_KEY="$(stoml ~/.config/fastly/config.toml token)"; \
rm -rf fastly/fixtures/s3* && \
make test TESTARGS="-run=S3 -count=1" && \
make fix-fixtures && \
unset FASTLY_TEST_SERVICE_ID FASTLY_API_KEY && \
make test

…field

Signed-off-by: Colton J. McCurdy <cmccurdy@fastly.com>
Signed-off-by: Colton J. McCurdy <cmccurdy@fastly.com>
@mccurdyc mccurdyc requested review from ezkl and phamann June 3, 2020 15:47
@mccurdyc mccurdyc added the enhancement New feature or request label Jun 3, 2020
@@ -290,6 +290,68 @@ wMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N
`
}

// pgpPublicKeyUpdate returns a PEM encoded PGP public key suitable for testing
// updates to the public key field.
func pgpPublicKeyUpdate() string {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm "iffy" on doing this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since there are fake keys all over the test suite, this doesn't bother me too much. Worth adding to the list of testing cleanup TODOs, though.

Copy link
Member

Choose a reason for hiding this comment

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

What are your concerns?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My main concern was just introducing another test helper that just returned some mocked data.

@@ -30,6 +30,38 @@ interactions:
- "12"
placement:
- waf_debug
public_key:
- |
Copy link
Contributor Author

@mccurdyc mccurdyc Jun 3, 2020

Choose a reason for hiding this comment

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

This is new

name:
- new-test-s3
public_key:
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 is the new field

@@ -27,10 +27,12 @@ func TestClient_S3s(t *testing.T) {
GzipLevel: 9,
Format: "format",
FormatVersion: 2,
ResponseCondition: "",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Explicitly setting zero value just to show that it is covered.

However without adding additional setup --- i.e., creating a valid response condition --- we can't set a value here.

Maybe a comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

The coverage here seems fine to me. If you think a comment will help highlight your concern in the future, go for it.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fin as-is

Version: tv.Number,
Name: "test-s3",
NewName: "new-test-s3",
PublicKey: pgpPublicKeyUpdate(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

update public key

@mccurdyc mccurdyc marked this pull request as ready for review June 3, 2020 16:12
@mccurdyc mccurdyc changed the title Add PublicKey field to S3 Updates Add PublicKey field to S3 all CRUD actions Jun 3, 2020
Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@@ -290,6 +290,68 @@ wMfrTEOvx0NxUM3rpaCgEmuWbB1G1Hu371oyr4srrr+N
`
}

// pgpPublicKeyUpdate returns a PEM encoded PGP public key suitable for testing
// updates to the public key field.
func pgpPublicKeyUpdate() string {
Copy link
Member

Choose a reason for hiding this comment

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

What are your concerns?

@@ -27,10 +27,12 @@ func TestClient_S3s(t *testing.T) {
GzipLevel: 9,
Format: "format",
FormatVersion: 2,
ResponseCondition: "",
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fin as-is

@mccurdyc mccurdyc merged commit c4599a1 into fastly:master Jun 3, 2020
@mccurdyc mccurdyc deleted the mccurdyc/s3-publickey-all branch June 3, 2020 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants