Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiments initial setup #259

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ trace-protobuf @Datadog/serverless
trace-mini-agent @Datadog/serverless
trace-utils @Datadog/serverless
serverless @Datadog/serverless

# no default owners
experimental/
42 changes: 42 additions & 0 deletions .github/workflows/experiments-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint experiments
on:
push:
paths:
- 'experimental/**' # Only run action when experiments have changed

env:
CARGO_TERM_COLOR: always

jobs:
rustfmt:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./experimental
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
defaults:
run:
working-directory: ./experimental
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: ${{ matrix.rust_version }}
- 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
41 changes: 41 additions & 0 deletions .github/workflows/experiments-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test experiments
on:
push:
paths:
- 'experimental/**' # Only run action when experiments have changed

env:
CARGO_TERM_COLOR: always

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]
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



2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Empty file added experimental/Cargo.toml
Empty file.
26 changes: 26 additions & 0 deletions experimental/README.md
Original file line number Diff line number Diff line change
@@ -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.


Loading