Unverified Commit 9699e04f authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Implement new `sdk-sync` tool (#1336)

* Copy `smithy-rs-sync` into new `sdk-sync`
* Refactor to use `Git` trait instead of `git2`
* Abstract out gradle commands
* Abstract out filesystem operations
* Add a mocked end to end test
* Load `versions.toml` for revision information
* Sync example commits into one aggregate commit
* Reorganize tests
* Only include smithy-rs commits that change the SDK
* Add `sdk-sync` to Docker build image
* Sync models
* Greatly increase debug logging
* Add git invocation tests
* Fix running in CI detection for Docker build image
* Rename `e2e_test` to `mock_e2e_test`
* Add full E2E test and fix a bug with change detection
parent d51774a1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ RUN set -eux; \
    cargo +${rust_nightly_version} install --path tools/api-linter; \
    cargo install --path tools/crate-hasher; \
    cargo install --path tools/sdk-lints; \
    cargo install --path tools/sdk-sync; \
    cargo install --path tools/sdk-versioner; \
    chmod g+rw -R /opt/cargo/registry

+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ test_tool "tools/api-linter" "${RUST_NIGHTLY_VERSION}"
test_tool "tools/crate-hasher" "${RUST_STABLE_VERSION}"
test_tool "tools/publisher" "${RUST_STABLE_VERSION}"
test_tool "tools/sdk-lints" "${RUST_STABLE_VERSION}"
test_tool "tools/sdk-sync" "${RUST_STABLE_VERSION}"
test_tool "tools/sdk-versioner" "${RUST_STABLE_VERSION}"
test_tool "tools/smithy-rs-sync" "${RUST_STABLE_VERSION}"
test_tool "tools/smithy-rs-tool-common" "${RUST_STABLE_VERSION}"
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ publish = false

[workspace]

[profile.release]
# prefer fast compile time over runtime performance
opt-level = 0

[dependencies]
anyhow = "1.0"
clap = { version = "3", features = ["derive"] }
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ publish = false

[workspace]

[profile.release]
# prefer fast compile time over runtime performance
opt-level = 0

[dependencies]
anyhow = "1.0"
async-recursion = "0.3.2"
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use crate::package::{discover_package_manifests, parse_version};
use crate::SDK_REPO_NAME;
use anyhow::{bail, Context, Result};
use semver::Version;
use smithy_rs_tool_common::github_actions::running_in_github_actions;
use smithy_rs_tool_common::ci::running_in_ci;
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
@@ -159,7 +159,7 @@ fn conditionally_disallow_publish(
    manifest_path: &Path,
    metadata: &mut toml::Value,
) -> Result<bool> {
    let is_github_actions = running_in_github_actions();
    let is_github_actions = running_in_ci();
    let is_example = is_example_manifest(manifest_path);

    // Safe-guard to prevent accidental publish to crates.io. Add some friction
Loading