Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmcdonald3 committed Sep 24, 2024
2 parents 512f13b + ea0fe50 commit f027f78
Show file tree
Hide file tree
Showing 129 changed files with 14,410 additions and 3,935 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# This local action sets up code dependencies
# to run Smithy-Dafny CI in GitHub Actions workflows.
#

name: "Install Smithy-Dafny codegen dependencies"
description: "Install Java package dependencies required to run Smithy-Dafny codegen"
runs:
using: "composite"
steps:
- name: Install smithy-dafny-codegen Rust dependencies locally
uses: gradle/gradle-build-action@v2
with:
arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML
build-root-directory: smithy-dafny/smithy-dafny-codegen-modules/smithy-rs

- name: Install smithy-dafny-codegen Python dependencies locally
uses: gradle/gradle-build-action@v2
with:
arguments: :smithy-python-codegen:pTML
build-root-directory: smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen
11 changes: 10 additions & 1 deletion .github/workflows/library_codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# The specification submodule is private so we don't have access, but we don't need
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny
- run: git submodule update --init --recursive smithy-dafny

# Only used to format generated code
# and to translate version strings such as "nightly-latest"
Expand All @@ -57,6 +57,15 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Setup Java 17 for codegen
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: "17"

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- uses: ./.github/actions/polymorph_codegen
with:
dafny: ${{ env.DAFNY_VERSION }}
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@ jobs:
uses: ./.github/workflows/library_interop_tests.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
pr-ci-all-required:
if: always()
needs:
- getVersion
- getVerifyVersion
- pr-ci-format
- pr-ci-codegen
- pr-ci-verification
- pr-ci-java
- pr-ci-net
- pr-interop-test
runs-on: ubuntu-latest
steps:
- name: Verify all required jobs passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
11 changes: 7 additions & 4 deletions .github/workflows/smithy-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
name: Check Smithy Files

on:
pull_request:
pull_request_review:
types: [submitted]

jobs:
require-approvals:
Expand All @@ -19,20 +20,22 @@ jobs:
- name: Get Files changed
id: file-changes
shell: bash
env:
GITHUB_HEAD: ${{github.event.pull_request.head.ref}}
run:
# Checks to see if any of the smithy Models are being updated.
# Doing this check allows us to catch things like, missing @javadoc trait documentation or bug in smithy dafny that has not be resolved.
echo "FILES=$(git diff --name-only origin/main origin/${GITHUB_HEAD_REF} | grep '\.smithy$' | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
echo "FILES=$(git diff --name-only origin/main origin/${GITHUB_HEAD} | grep '\.smithy$' | tr '\n' ' ')" >> "$GITHUB_OUTPUT"

- name: Check if FILES is not empty
id: comment
env:
PR_NUMBER: ${{ github.event.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILES: ${{ steps.file-changes.outputs.FILES }}
if: ${{env.FILES != ''}}
run: |
# TODO: If https://github.com/smithy-lang/smithy-dafny/issues/491 is resolved, remove comment about this issue.
COMMENT="@${{github.actor}}, I noticed you are updating the smithy model files.\nDoes this update need new or updated javadoc trait documentation?\n Are you adding constraints inside list, map or union? Do you know about this issue: https://github.com/smithy-lang/smithy-dafny/issues/491?"
COMMENT="@${{github.event.pull_request.user.login}} and @${{github.actor}}, I noticed you are updating the smithy model files.\nDoes this update need new or updated user documentation?\n Are you adding constraints inside list, map or union? Do you know about this issue: https://github.com/smithy-lang/smithy-dafny/issues/491?"
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
10 changes: 0 additions & 10 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
// We model all the files and the runtimes here in this structure
const Runtimes = {
java: {
"project.properties": {
dependencies: [],
},
"AwsCryptographicMaterialProviders/runtimes/java/build.gradle.kts": {
dependencies: [],
},
Expand Down Expand Up @@ -84,13 +81,6 @@ module.exports = {
replacements: [
// Update the version for all Gradle Java projects
// Does not update the dependencies
{
files: Object.keys(Runtimes.java),
from: 'mplVersion=".*"',
to: 'mplVersion="${nextRelease.version}"',
results: Object.keys(Runtimes.java).map(CheckResults),
countMatches: true,
},
{
files: Object.keys(Runtimes.java),
from: 'version = ".*"',
Expand Down
2 changes: 2 additions & 0 deletions AwsCryptographicMaterialProviders/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
TestResults
ImplementationFromDafny.cs
TestsFromDafny.cs
ImplementationFromDafny-cs.dtr
TestsFromDafny-cs.dtr

**/bin
**/obj
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git b/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographicMaterialProviders/TypeConversion.cs a/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographicMaterialProviders/TypeConversion.cs
index b10e603c..89561181 100644
index e05ad66e..7b6ad3a7 100644
--- b/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographicMaterialProviders/TypeConversion.cs
+++ a/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographicMaterialProviders/TypeConversion.cs
@@ -3436,7 +3436,9 @@ namespace AWS.Cryptography.MaterialProviders
@@ -3872,7 +3872,9 @@ namespace AWS.Cryptography.MaterialProviders
dafnyVal._ComAmazonawsDynamodb
);
case software.amazon.cryptography.materialproviders.internaldafny.types.Error_ComAmazonawsKms dafnyVal:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git b/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographyKeyStore/TypeConversion.cs a/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographyKeyStore/TypeConversion.cs
index f5ef0458..f846a946 100644
index 95c9eba1..bcd537fb 100644
--- b/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographyKeyStore/TypeConversion.cs
+++ a/AwsCryptographicMaterialProviders/runtimes/net/Generated/AwsCryptographyKeyStore/TypeConversion.cs
@@ -629,7 +629,9 @@ namespace AWS.Cryptography.KeyStore
@@ -732,7 +732,9 @@ namespace AWS.Cryptography.KeyStore
dafnyVal._ComAmazonawsDynamodb
);
case software.amazon.cryptography.keystore.internaldafny.types.Error_ComAmazonawsKms dafnyVal:
Expand All @@ -13,7 +13,7 @@ index f5ef0458..f846a946 100644
dafnyVal._ComAmazonawsKms
);
case software.amazon.cryptography.keystore.internaldafny.types.Error_KeyStoreException dafnyVal:
@@ -652,7 +654,9 @@ namespace AWS.Cryptography.KeyStore
@@ -755,7 +757,9 @@ namespace AWS.Cryptography.KeyStore
{
case "Com.Amazonaws.KMS":
return software.amazon.cryptography.keystore.internaldafny.types.Error.create_ComAmazonawsKms(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ module {:extern "software.amazon.cryptography.materialproviders.internaldafny.ty
| SingleThreaded(SingleThreaded: SingleThreadedCache)
| MultiThreaded(MultiThreaded: MultiThreadedCache)
| StormTracking(StormTracking: StormTrackingCache)
| Shared(Shared: ICryptographicMaterialsCache)
class IClientSupplierCallHistory {
ghost constructor() {
GetClient := [];
Expand Down Expand Up @@ -823,7 +824,8 @@ module {:extern "software.amazon.cryptography.materialproviders.internaldafny.ty
nameonly branchKeyIdSupplier: Option<IBranchKeyIdSupplier> := Option.None ,
nameonly keyStore: AwsCryptographyKeyStoreTypes.IKeyStoreClient ,
nameonly ttlSeconds: PositiveLong ,
nameonly cache: Option<CacheType> := Option.None
nameonly cache: Option<CacheType> := Option.None ,
nameonly partitionId: Option<string> := Option.None
)
datatype CreateAwsKmsKeyringInput = | CreateAwsKmsKeyringInput (
nameonly kmsKeyId: KmsKeyId ,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ union CacheType {
No: NoCache,
SingleThreaded: SingleThreadedCache,
MultiThreaded: MultiThreadedCache,
StormTracking: StormTrackingCache
StormTracking: StormTrackingCache,
@documentation("Shared cache across multiple Hierarchical Keyrings. For this cache type, the user should provide an already constructed CryptographicMaterialsCache to the Hierarchical Keyring at initialization.")
Shared: CryptographicMaterialsCacheReference
}

structure CreateCryptographicMaterialsCacheInput {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,11 @@ structure CreateAwsKmsHierarchicalKeyringInput {
@javadoc("How many seconds the Branch Key material is allowed to be reused within the local cache before it is re-retrieved from Amazon DynamoDB and re-authenticated with AWS KMS.")
ttlSeconds: PositiveLong,

@javadoc("Which type of local cache to use.")
@documentation("Sets the type of cache for this Hierarchical Keyring. By providing an already initialized 'Shared' cache, users can determine the scope of the cache. That is, if the cache is shared across other Cryptographic Material Providers, for instance other Hierarchical Keyrings or Caching Cryptographic Materials Managers (Caching CMMs). If any other type of cache in the CacheType union is provided, the Hierarchical Keyring will initialize a cache of that type, to be used with only this Hierarchical Keyring. If not set, a DefaultCache is initialized to be used with only this Hierarchical Keyring with entryCapacity = 1000.")
cache : CacheType

@documentation("Partition ID to distinguish Cryptographic Material Providers (i.e: Keyrings) writing to a cache. If the Partition ID is the same for two Hierarchical Keyrings (or another Material Provider), they can share the same cache entries in the cache.")
partitionId : String
}

// Raw
Expand Down
Loading

0 comments on commit f027f78

Please sign in to comment.