Skip to content

feat: update sns, add attributes and context params - #218

Open
bpeng wants to merge 2 commits into
mainfrom
sns-update
Open

bpeng wants to merge 2 commits into
mainfrom
sns-update

Conversation

@bpeng

@bpeng bpeng commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

Resolves #.

Changes proposed in this pull request:

  • Add attributes and context params to sns publish

Production Changes

The following production changes are required to deploy these changes:

  • None

Review

Check the box that applies to this code review. If necessary please seek help with adding a checklist guide for the reviewer.
When assigning the code review please consider the expertise needed to review the changes.

  • This is a content (documentation, web page etc) only change.
  • This is a minor change (meta data, bug fix, improve test coverage etc).
  • This is a larger change (new feature, significant refactoring etc). Please use the code review guidelines to add a checklist below to guide the code reviewer.

Code Review Guide

Insert check list here if needed.

@bpeng
bpeng requested a review from CallumNZ October 21, 2026 01:22
Comment thread aws/sns/sns.go Outdated
Comment on lines +83 to +84
// PublishWithAttributesWithContext publishes message to topicArn with the supplied message attributes using ctx.
func (s *SNS) PublishWithAttributesWithContext(ctx context.Context, topicArn string, message []byte, messageAttributes map[string]types.MessageAttributeValue) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the WithContext was a patch to not break existing code. Since PublishWithAttributes doesn't exist yet, might as well add ctx to that one.

@CallumNZ

Copy link
Copy Markdown
Contributor

Need a test for each new method.

var m SNSMessage
err = json.Unmarshal([]byte(awsCmdReceiveMessage(testQueue)), &m)
require.Nil(t, err)
assert.Equal(t, testMessage, m.Message)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would be good to do it like the S3 test, otherwise we don't know if the passed in context is being used:

t.Run("cancelled", func(t *testing.T) {

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