Skip to content

Commit

Permalink
Merge pull request #116 from awslabs/dev
Browse files Browse the repository at this point in the history
Merge Changes from Dev to Main
  • Loading branch information
philasmar committed Mar 26, 2024
2 parents 9c05f1c + 2bf182d commit 8e9d33e
Show file tree
Hide file tree
Showing 15 changed files with 590 additions and 38 deletions.
19 changes: 19 additions & 0 deletions .autover/autover.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"Projects": [
{
"Name": "AWS.Messaging",
"Path": "src/AWS.Messaging/AWS.Messaging.csproj"
},
{
"Name": "AWS.Messaging.Lambda",
"Path": "src/AWS.Messaging.Lambda/AWS.Messaging.Lambda.csproj"
},
{
"Name": "AWS.Messaging.Telemetry.OpenTelemetry",
"Path": "src/AWS.Messaging.Telemetry.OpenTelemetry/AWS.Messaging.Telemetry.OpenTelemetry.csproj"
}
],
"UseCommitsForChangelog": false,
"DefaultIncrementType": "Patch",
"ChangeFilesDetermineIncrementType": true
}
25 changes: 25 additions & 0 deletions .autover/changes/519a5032-f249-4598-a46e-58bba51e109e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Projects": [
{
"Name": "AWS.Messaging",
"Type": "Minor",
"ChangelogMessages": [
"**AWS.Messaging** is now in _**Developer Preview**_"
]
},
{
"Name": "AWS.Messaging.Lambda",
"Type": "Minor",
"ChangelogMessages": [
"**AWS.Messaging.Lambda** is now in _**Developer Preview**_"
]
},
{
"Name": "AWS.Messaging.Telemetry.OpenTelemetry",
"Type": "Minor",
"ChangelogMessages": [
"**AWS.Messaging.Telemetry.OpenTelemetry** is now in _**Developer Preview**_"
]
}
]
}
84 changes: 84 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# This GitHub Workflow will create a new release branch that contains the updated C# project versions and changelog.
# The workflow will also create a PR that targets `dev` from the release branch.
name: Create Release PR

# This workflow is manually triggered when in preparation for a release. The workflow should be dispatched from the `dev` branch.
on:
workflow_dispatch:
inputs:
OVERRIDE_VERSION:
description: "Override Version"
type: string
required: false

jobs:
release-pr:
name: Release PR
runs-on: ubuntu-latest

env:
INPUT_OVERRIDE_VERSION: ${{ github.event.inputs.OVERRIDE_VERSION }}

steps:
# Checkout a full clone of the repo
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
# Install .NET8 which is needed for AutoVer
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Install AutoVer to automate versioning and changelog creation
- name: Install AutoVer
run: dotnet tool install --global AutoVer --version 0.0.20
# Set up a git user to be able to run git commands later on
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "aws-sdk-dotnet-automation"
# Create the release branch which will contain the version changes and updated changelog
- name: Create Release Branch
id: create-release-branch
run: |
branch=releases/next-release
git checkout -b $branch
echo "BRANCH=$branch" >> $GITHUB_OUTPUT
# Update the version of projects based on the change files
- name: Increment Version
run: autover version
if: env.INPUT_OVERRIDE_VERSION == ''
# Update the version of projects based on the override version
- name: Increment Version
run: autover version --use-version "$INPUT_OVERRIDE_VERSION"
if: env.INPUT_OVERRIDE_VERSION != ''
# Update the changelog based on the change files
- name: Update Changelog
run: autover changelog
# Push the release branch up as well as the created tag
- name: Push Changes
run: |
branch=${{ steps.create-release-branch.outputs.BRANCH }}
git push origin $branch
git push origin $branch --tags
# Get the release name that will be used to create a PR
- name: Read Release Name
id: read-release-name
run: |
version=$(autover changelog --release-name)
echo "VERSION=$version" >> $GITHUB_OUTPUT
# Get the changelog that will be used to create a PR
- name: Read Changelog
id: read-changelog
run: |
changelog=$(autover changelog --output-to-console)
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
# Create the Release PR and label it
- name: Create Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_url="$(gh pr create --title "${{ steps.read-release-name.outputs.VERSION }}" --body "${{ steps.read-changelog.outputs.CHANGELOG }}" --base dev --head ${{ steps.create-release-branch.outputs.BRANCH }})"
gh label create "Release PR" --description "A Release PR that includes versioning and changelog changes" -c "#FF0000" -f
gh pr edit $pr_url --add-label "Release PR"
122 changes: 122 additions & 0 deletions .github/workflows/sync-main-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# This GitHub Workflow is designed to run automatically after the Release PR, which was created by the `Create Release PR` workflow, is closed.
# This workflow has 2 jobs. One will run if the `Release PR` is successfully merged, indicating that a release should go out.
# The other will run if the `Release PR` was closed and a release is not intended to go out.
name: Sync 'dev' and 'main'

# The workflow will automatically be triggered when any PR is closed.
on:
pull_request:
types: [closed]

permissions:
contents: write

jobs:
# This job will check if the PR was successfully merged, it's source branch is `releases/next-release` and target branch is `dev`.
# This indicates that the merged PR was the `Release PR`.
# This job will synchronize `dev` and `main`, create a GitHub Release and delete the `releases/next-release` branch.
sync-dev-and-main:
name: Sync dev and main
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.head.ref == 'releases/next-release' &&
github.event.pull_request.base.ref == 'dev'
runs-on: ubuntu-latest
steps:
# Checkout a full clone of the repo
- name: Checkout code
uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
# Install .NET8 which is needed for AutoVer
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Install AutoVer which is needed to retrieve information about the current release.
- name: Install AutoVer
run: dotnet tool install --global AutoVer --version 0.0.20
# Set up a git user to be able to run git commands later on
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "aws-sdk-dotnet-automation"
# Retrieve the release name which is needed for the GitHub Release
- name: Read Release Name
id: read-release-name
run: |
version=$(autover changelog --release-name)
echo "VERSION=$version" >> $GITHUB_OUTPUT
# Retrieve the tag name which is needed for the GitHub Release
- name: Read Tag Name
id: read-tag-name
run: |
tag=$(autover changelog --tag-name)
echo "TAG=$tag" >> $GITHUB_OUTPUT
# Retrieve the changelog which is needed for the GitHub Release
- name: Read Changelog
id: read-changelog
run: |
changelog=$(autover changelog --output-to-console)
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
# Merge dev into main in order to synchronize the 2 branches
- name: Merge dev to main
run: |
git fetch origin
git checkout main
git merge dev
git push origin main
# Create the GitHub Release
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${{ steps.read-tag-name.outputs.TAG }}" --title "${{ steps.read-release-name.outputs.VERSION }}" --notes "${{ steps.read-changelog.outputs.CHANGELOG }}"
# Delete the `releases/next-release` branch
- name: Clean up
run: |
git fetch origin
git push origin --delete releases/next-release
# This job will check if the PR was closed, it's source branch is `releases/next-release` and target branch is `dev`.
# This indicates that the closed PR was the `Release PR`.
# This job will delete the tag created by AutoVer and the release branch.
clean-up-closed-release:
name: Clean up closed release
if: |
github.event.pull_request.merged == false &&
github.event.pull_request.head.ref == 'releases/next-release' &&
github.event.pull_request.base.ref == 'dev'
runs-on: ubuntu-latest
steps:
# Checkout a full clone of the repo
- name: Checkout code
uses: actions/checkout@v4
with:
ref: releases/next-release
fetch-depth: 0
# Install .NET8 which is needed for AutoVer
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Install AutoVer which is needed to retrieve information about the current release.
- name: Install AutoVer
run: dotnet tool install --global AutoVer --version 0.0.20
# Set up a git user to be able to run git commands later on
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "aws-sdk-dotnet-automation"
# Retrieve the tag name to be deleted
- name: Read Tag Name
id: read-tag-name
run: |
tag=$(autover changelog --tag-name)
echo "TAG=$tag" >> $GITHUB_OUTPUT
# Delete the tag created by AutoVer and the release branch
- name: Clean up
run: |
git fetch origin
git push --delete origin ${{ steps.read-tag-name.outputs.TAG }}
git push origin --delete releases/next-release
47 changes: 23 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# Changelog
## Release 2024-03-20

### Release 2024-03-20
* **AWS.Messaging (0.3.0-beta)**
* Added back-off logic to the SQS Poller that can perform Exponential, Interval or disable back-offs entirely. The SQS Poller will now back-off before attempting to reach SQS in case of an exception.
* Added support for SourceLink
* **AWS.Messaging.Lambda (0.1.1-beta)**
* Added support for SourceLink
* **AWS.Messaging.Telemetry.OpenTelemetry (0.1.1-beta)**
* Added support for SourceLink
### AWS.Messaging (0.3.0-beta)
* Added back-off logic to the SQS Poller that can perform Exponential, Interval or disable back-offs entirely. The SQS Poller will now back-off before attempting to reach SQS in case of an exception.
* Added support for SourceLink
### AWS.Messaging.Lambda (0.1.1-beta)
* Added support for SourceLink
### AWS.Messaging.Telemetry.OpenTelemetry (0.1.1-beta)
* Added support for SourceLink

### Release 2024-03-08
* **AWS.Messaging (0.2.0-beta)**
* BREAKING CHANGE: Message content is no longer included by default in logs or exceptions. Call `EnableDataMessageLogging` during setup to re-enable.
* BREAKING CHANGE: Replaced `IsSQSExceptionFatal` with `IsExceptionFatal` to allow classifying a broader range of exceptions. Expanded the default list of fatal exceptions.
* BREAKING CHANGE: Renamed `PublishAsync` to `SendAsync on the SQS-specific publisher, and create separate interface definitions to clarify "publishing" vs. "sending" depending on the destination service.
* Allow overriding the destination and AWS service client on the service-specific publishers. This allows you to set the destination and credentials on a per-message basis, which may be useful for multi-tenant applications.
* Improved validation on ECS task metadata when deriving the default value for the message source on ECS.
* Improved documentation and examples around `IMessagePublisher`
## Release 2024-03-08
### AWS.Messaging (0.2.0-beta)
* BREAKING CHANGE: Message content is no longer included by default in logs or exceptions. Call `EnableDataMessageLogging` during setup to re-enable.
* BREAKING CHANGE: Replaced `IsSQSExceptionFatal` with `IsExceptionFatal` to allow classifying a broader range of exceptions. Expanded the default list of fatal exceptions.
* BREAKING CHANGE: Renamed `PublishAsync` to `SendAsync on the SQS-specific publisher, and create separate interface definitions to clarify "publishing" vs. "sending" depending on the destination service.
* Allow overriding the destination and AWS service client on the service-specific publishers. This allows you to set the destination and credentials on a per-message basis, which may be useful for multi-tenant applications.
* Improved validation on ECS task metadata when deriving the default value for the message source on ECS.
* Improved documentation and examples around `IMessagePublisher`

### Release 2023-12-08
* **AWS.Messaging (0.1.0-beta)**
* Initial _**beta**_ release.
* **AWS.Messaging.Lambda (0.1.0-beta)**
* Initial _**beta**_ release.
* **AWS.Messaging.Telemetry.OpenTelemetry (0.1.0-beta)**
* Initial _**beta**_ release.
## Release 2023-12-08
### AWS.Messaging (0.1.0-beta)
* Initial _**beta**_ release.
### AWS.Messaging.Lambda (0.1.0-beta)
* Initial _**beta**_ release.
### AWS.Messaging.Telemetry.OpenTelemetry (0.1.0-beta)
* Initial _**beta**_ release.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
[![nuget](https://img.shields.io/nuget/v/AWS.Messaging.svg) ![downloads](https://img.shields.io/nuget/dt/AWS.Messaging.svg)](https://www.nuget.org/packages/AWS.Messaging/)
[![build status](https://img.shields.io/github/actions/workflow/status/awslabs/aws-dotnet-messaging/aws-ci.yml?branch=dev)](https://github.com/awslabs/aws-dotnet-messaging/actions/workflows/aws-ci.yml)

**Notice:** *This library is still in active development and is meant for early access and feedback purposes only. It should not be used in production environments, and any releases before 1.0.0 might include breaking changes.*
**Notice:** *This library is in **developer preview**. It provides early access to upcoming features in the **AWS Message Processing Framework for .NET**. Any releases prior to 1.0.0 might include breaking changes.*

The **AWS Message Processing Framework for .NET** is an AWS-native framework that simplifies the development of .NET message processing applications that use AWS services, such as Amazon Simple Queue Service (SQS), Amazon Simple Notification Service (SNS), and Amazon EventBridge. The framework reduces the amount of boiler-plate code developers need to write, allowing you to focus on your business logic when publishing and consuming messages.
* For publishers, the framework serializes the message from a .NET object to a [CloudEvents](https://cloudevents.io/)-compatible message, and then wraps that in the service-specific AWS message. It then publishes the message to the configured SQS queue, SNS topic, or EventBridge event bus.
* For consumers, the framework deserializes the message to its .NET object and routes it to the appropriate business logic. The framework also keeps track of the message visibility while it is being processed (to avoid processing a message more than once), and deletes the message from the queue when completed. The framework supports consuming messages in both long-running polling processes and in AWS Lambda functions.

## Project Status

The framework is currently under active development. It already supports:
The framework is currently in **developer preview**. The following features are supported:
* Publishing to SQS, SNS, and EventBridge
* Handling SQS messages in a long-running, polling process
* Handling SQS messages in AWS Lambda functions
Expand Down
2 changes: 1 addition & 1 deletion src/AWS.Messaging.Lambda/AWS.Messaging.Lambda.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.2.0" />
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="2.2.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AWS.Messaging.Lambda/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AWS Lambda plugin for AWS Message Processing Framework for .NET
[![nuget](https://img.shields.io/nuget/v/AWS.Messaging.Lambda.svg) ![downloads](https://img.shields.io/nuget/dt/AWS.Messaging.Lambda.svg)](https://www.nuget.org/packages/AWS.Messaging.Lambda/)

**Notice:** *This library is still in early active development and is not ready for use beyond experimentation.*
**Notice:** *This library is in **developer preview**. It provides early access to upcoming features in the **AWS Message Processing Framework for .NET**. Any releases prior to 1.0.0 might include breaking changes.*

This package is a plugin for the [AWS Message Processing Framework for .NET](https://github.com/awslabs/aws-dotnet-messaging) that allows a .NET Lambda function to handle messages that were published by the framework.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<ItemGroup>
<PackageReference Include="OpenTelemetry" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Api" Version="1.6.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AWS.Messaging.Telemetry.OpenTelemetry/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OpenTelemetry plugin for AWS Message Processing Framework for .NET
[![nuget](https://img.shields.io/nuget/v/AWS.Messaging.Telemetry.OpenTelemetry.svg) ![downloads](https://img.shields.io/nuget/dt/AWS.Messaging.Telemetry.OpenTelemetry.svg)](https://www.nuget.org/packages/AWS.Messaging.Telemetry.OpenTelemetry/)

**Notice:** *This library is still in early active development and is not ready for use beyond experimentation.*
**Notice:** *This library is in **developer preview**. It provides early access to upcoming features in the **AWS Message Processing Framework for .NET**. Any releases prior to 1.0.0 might include breaking changes.*

This package is an [Instrumentation
Library](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library), which instruments the [AWS Message Processing Framework for .NET](https://github.com/awslabs/aws-dotnet-messaging) to collect traces about
Expand Down
2 changes: 1 addition & 1 deletion src/AWS.Messaging/AWS.Messaging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.*" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 8e9d33e

Please sign in to comment.