From f5b6aefedda2cbea79deb9301d9fa6c3b664ebc3 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Fri, 22 Sep 2023 15:14:34 +0200 Subject: [PATCH 1/3] Experiments initial setup --- .github/CODEOWNERS | 3 ++ .github/workflows/experiments-lint.yml | 40 ++++++++++++++++++++++++ .github/workflows/experiments-test.yml | 42 ++++++++++++++++++++++++++ experimental/README.md | 26 ++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 .github/workflows/experiments-lint.yml create mode 100644 .github/workflows/experiments-test.yml create mode 100644 experimental/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 07030f520..734cb2eb1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,3 +16,6 @@ trace-protobuf @Datadog/serverless trace-mini-agent @Datadog/serverless trace-utils @Datadog/serverless serverless @Datadog/serverless + +# no default owners +experimental/ \ No newline at end of file diff --git a/.github/workflows/experiments-lint.yml b/.github/workflows/experiments-lint.yml new file mode 100644 index 000000000..d7825cc9c --- /dev/null +++ b/.github/workflows/experiments-lint.yml @@ -0,0 +1,40 @@ +name: Lint experiments +on: + push: + paths: + - 'experimental/**' # Only run action when experiments have changed + +defaults: + run: + working-directory: ./experimental + +env: + CARGO_TERM_COLOR: always + +jobs: + rustfmt: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + - name: Install latest nightly toolchain and rustfmt + run: rustup update nightly && rustup default nightly && rustup component add rustfmt + clippy: + name: "clippy #${{ matrix.rust_version }}" + strategy: + fail-fast: false + matrix: + rust_version: ["stable"] + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + with: + rust_version: ${{ matrix.rust_version }} + - name: Install ${{ matrix.version }} toolchain and clippy + run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy + - run: cargo clippy --all-targets --all-features -- -D warnings \ No newline at end of file diff --git a/.github/workflows/experiments-test.yml b/.github/workflows/experiments-test.yml new file mode 100644 index 000000000..0d86b2b24 --- /dev/null +++ b/.github/workflows/experiments-test.yml @@ -0,0 +1,42 @@ +name: Test experiments +on: + push: + paths: + - 'experimental/**' # Only run action when experiments have changed + +defaults: + run: + working-directory: ./experimental + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: "cargo test --workspace #${{ matrix.platform }} ${{ matrix.rust_version }}" + runs-on: ${{ matrix.platform }} + strategy: + matrix: + platform: [windows-latest, ubuntu-latest, macos-12] + rust_version: [""] + steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Cache + uses: ./.github/actions/cache + with: + rust_version: ${{ matrix.rust_version }} + - name: Install Rust ${{ matrix.rust_version }} + if: ${{ matrix.rust_version != '' }} + run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} + - id: rust-version + run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT + - name: "[${{ steps.rust-version.outputs.version}}] cargo build --workspace --verbose" + run: cargo build --workspace --verbose + - name: "[${{ steps.rust-version.outputs.version}}] cargo test --workspace --verbose" + run: cargo test --workspace --verbose + env: + RUST_BACKTRACE: 1 + + + \ No newline at end of file diff --git a/experimental/README.md b/experimental/README.md new file mode 100644 index 000000000..f8758bef4 --- /dev/null +++ b/experimental/README.md @@ -0,0 +1,26 @@ +# Shared library experiments and POC + +In past a lot of interesting projects have been kept eternally on a branch of libdatadog. + +However this has made collaboration and reuse of code within core of libdatadog harder. + +As a consequences, we've discussed in the past the idea of having a semi-temporary experiments sub project within libdatadog. Where all those not yet-production ready (or meant for production) projects can live, and facilitiate code reuse and better collaboration based on Pull requests. + +## Rules for experiments + +For now *by default* all of the projects withing `experimental` namespace should not be build alongside the full libdatadog crate, to avoid unnecessary increase of build times and the complexity of the libdatadog's CI. + +Experiments are free to add CI configuration as they see fit. They should however prefer to constrain the CI run only to their own folders, e.g. + +``` +name: Experimental CI +on: + push: + paths: + - 'experimental/custom-parsing/**' # Only run action when custom parsing code has changes + +``` + +To simplify the experiment setup - an experimental Cargo workspace will be created - experiments are free to add themselves to the workspace - however its not mandatory. The workspace purpose will mostly be relegeated to CI automations. + + From 05a2f259d3bdc5edc06e29f78bd33e141a326b60 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Fri, 22 Sep 2023 15:22:10 +0200 Subject: [PATCH 2/3] wip --- .github/workflows/experiments-lint.yml | 12 +++++++----- .github/workflows/experiments-test.yml | 7 +++---- .github/workflows/lint.yml | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/experiments-lint.yml b/.github/workflows/experiments-lint.yml index d7825cc9c..a5b3432a7 100644 --- a/.github/workflows/experiments-lint.yml +++ b/.github/workflows/experiments-lint.yml @@ -4,16 +4,15 @@ on: paths: - 'experimental/**' # Only run action when experiments have changed -defaults: - run: - working-directory: ./experimental - env: CARGO_TERM_COLOR: always jobs: rustfmt: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./experimental steps: - name: Checkout sources uses: actions/checkout@v3 @@ -28,6 +27,9 @@ jobs: matrix: rust_version: ["stable"] runs-on: ubuntu-latest + defaults: + run: + working-directory: ./experimental steps: - name: Checkout sources uses: actions/checkout@v3 @@ -35,6 +37,6 @@ jobs: uses: ./.github/actions/cache with: rust_version: ${{ matrix.rust_version }} - - name: Install ${{ matrix.version }} toolchain and clippy + - name: Install ${{ matrix.rust_version }} toolchain and clippy run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy - run: cargo clippy --all-targets --all-features -- -D warnings \ No newline at end of file diff --git a/.github/workflows/experiments-test.yml b/.github/workflows/experiments-test.yml index 0d86b2b24..f984ab3c8 100644 --- a/.github/workflows/experiments-test.yml +++ b/.github/workflows/experiments-test.yml @@ -4,10 +4,6 @@ on: paths: - 'experimental/**' # Only run action when experiments have changed -defaults: - run: - working-directory: ./experimental - env: CARGO_TERM_COLOR: always @@ -15,6 +11,9 @@ jobs: test: name: "cargo test --workspace #${{ matrix.platform }} ${{ matrix.rust_version }}" runs-on: ${{ matrix.platform }} + defaults: + run: + working-directory: ./experimental strategy: matrix: platform: [windows-latest, ubuntu-latest, macos-12] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b4814462f..c615d6a1d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ jobs: uses: ./.github/actions/cache with: rust_version: ${{ matrix.rust_version }} - - name: Install ${{ matrix.version }} toolchain and clippy + - name: Install ${{ matrix.rust_version }} toolchain and clippy run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy - run: cargo clippy --all-targets --all-features -- -D warnings licensecheck: From b99b3c3801ed52cb693d73a3b631b23bb072a7f6 Mon Sep 17 00:00:00 2001 From: Pawel Chojnacki Date: Fri, 22 Sep 2023 18:53:34 +0200 Subject: [PATCH 3/3] wip --- experimental/Cargo.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 experimental/Cargo.toml diff --git a/experimental/Cargo.toml b/experimental/Cargo.toml new file mode 100644 index 000000000..e69de29bb