Unverified Commit 92316f75 authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Add CI check for deterministic codegen (#2509)

* Add CI check for deterministic codegen

* Fix typo

* Mark files as executable

* Fix argument count from 1 to 0

* Fix diff script

* Fix error in generate_and_commit function

* Cleanup command output

* Fix codegen-diff script

* Sort member params to fix codegen non-determinism
parent 65058d9d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ jobs:
          runner: ubuntu-latest
        - action: check-tools
          runner: smithy_ubuntu-latest_8-core
        - action: check-deterministic-codegen
          runner: smithy_ubuntu-latest_8-core
    steps:
    - uses: actions/checkout@v3
      with:
+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ fun eventStreamAllowList(): Set<String> {
fun generateSmithyBuild(services: AwsServices): String {
    val awsConfigVersion = properties.get("smithy.rs.runtime.crate.version")
        ?: throw IllegalStateException("missing smithy.rs.runtime.crate.version for aws-config version")
    val debugMode = properties.get("debugMode").toBoolean()
    val serviceProjections = services.services.map { service ->
        val files = service.modelFiles().map { extraFile ->
            software.amazon.smithy.utils.StringUtils.escapeJavaString(
@@ -99,6 +100,7 @@ fun generateSmithyBuild(services: AwsServices): String {
                        "codegen": {
                            "includeFluentClient": false,
                            "renameErrors": false,
                            "debugMode": $debugMode,
                            "eventStreamAllowList": [$eventStreamAllowListMembers],
                            "enableNewCrateOrganizationScheme": true,
                            "enableNewSmithyRuntime": false
+4 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ generate-aws-sdk:
generate-codegen-diff:
	$(CI_ACTION) $@ $(ARGS)

.PHONY: check-deterministic-codegen
check-deterministic-codegen:
	$(CI_ACTION) $@ $(ARGS)

.PHONY: generate-smithy-rs-release
generate-smithy-rs-release:
	$(CI_ACTION) $@ $(ARGS)
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ class EndpointsDecorator : ClientCodegenDecorator {
        }

        private fun builderFields(params: Parameters, section: OperationSection.MutateInput) = writable {
            val memberParams = idx.getContextParams(operationShape)
            val memberParams = idx.getContextParams(operationShape).toList().sortedBy { it.first.memberName }
            val builtInParams = params.toList().filter { it.isBuiltIn }
            // first load builtins and their defaults
            builtInParams.forEach { param ->

tools/__init__.py

0 → 100644
+2 −0
Original line number Diff line number Diff line
#  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#  SPDX-License-Identifier: Apache-2.0
Loading