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

Add initial setup for splitting composer packages #682

Merged
merged 7 commits into from
May 24, 2022
Merged
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
23 changes: 23 additions & 0 deletions .github/workflows/split-monorepo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: gitsplit
on:
push:
branches:
- main
- split
release:
types: [published]
create:
workflow_dispatch:

jobs:
gitsplit:
runs-on: ubuntu-latest
steps:
- name: checkout
run: git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" "$GITHUB_WORKSPACE" && cd "$GITHUB_WORKSPACE" && git checkout $GITHUB_SHA
- name: Split repositories
uses: docker://jderusse/gitsplit:latest
with:
args: gitsplit
env:
GH_TOKEN: ${{ secrets.GITSPLIT_TOKEN }}
30 changes: 30 additions & 0 deletions .gitsplit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Path to a cache directory Used to speed up the split over time by reusing git's objects
cache_url: "/cache/gitsplit"

# Path to the repository to split (default = current path)
project_url: "https://github.com/open-telemetry/opentelemetry-php.git"

# List of splits.
splits:
- prefix: "proto/otel"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/gen-otlp-protobuf.git"
- prefix: "thrift/jaeger"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/gen-jaeger-thrift.git"
- prefix: "src/Context"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/context.git"
- prefix: "src/SemConv"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/sem-conv.git"
- prefix: "src/API"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/api.git"
- prefix: "src/SDK"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/sdk.git"
- prefix: "src/Contrib"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/sdk-contrib.git"

# List of references to split (defined as regexp)
origins:
- ^main$
- ^test$
- ^split$
- ^v\d+\.\d+\.\d+$
- ^\d+\.\d+\.\d+$
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ w3c-test-service:
@docker-compose -f docker-compose.w3cTraceContext.yaml run --rm php ./tests/TraceContext/W3CTestService/symfony-setup
semconv:
./script/semantic-conventions/semconv.sh
split:
docker-compose -f docker/gitsplit/docker-compose.yaml --env-file ./.env up
FORCE:
9 changes: 9 additions & 0 deletions docker/gitsplit/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.7'
services:
gitsplit:
image: jderusse/gitsplit
volumes:
- ../../:/srv
- ../../var/cache/gitsplit:/cache/gitsplit
environment:
GH_TOKEN: ${GITSPLIT_TOKEN:-''}
2 changes: 1 addition & 1 deletion proto/otel/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "open-telemetry/proto-otel",
"name": "open-telemetry/gen-otlp-protobuf",
"description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.",
"keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "gRPC", "protobuf", "otlp"],
"type": "library",
Expand Down
2 changes: 1 addition & 1 deletion src/API/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"autoload": {
"psr-4": {
"OpenTelemetry\\API\\": ""
"OpenTelemetry\\API\\": "."
}
}
}
2 changes: 1 addition & 1 deletion src/Context/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"autoload": {
"psr-4": {
"OpenTelemetry\\Context\\": ""
"OpenTelemetry\\Context\\": "."
}
},
"suggest": {
Expand Down
4 changes: 3 additions & 1 deletion src/Contrib/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"nyholm/dsn": "^2.0.0",
"open-telemetry/api": "self.version",
"open-telemetry/context": "self.version",
"open-telemetry/gen-jaeger-thrift": "self.version",
"open-telemetry/gen-otlp-protobuf": "self.version",
"open-telemetry/proto-otel": "self.version",
"open-telemetry/sdk": "self.version",
"open-telemetry/sem-conv": "self.version",
Expand All @@ -28,7 +30,7 @@
},
"autoload": {
"psr-4": {
"OpenTelemetry\\Contrib\\": ""
"OpenTelemetry\\Contrib\\": "."
}
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/SDK/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"autoload": {
"psr-4": {
"OpenTelemetry\\SDK\\": ""
"OpenTelemetry\\SDK\\": "."
}
},
"suggest": {
Expand Down
22 changes: 22 additions & 0 deletions thrift/jaeger/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "open-telemetry/gen-jaeger-thrift",
"description": "PHP Thrift files for communication with Jaeger.",
"keywords": ["opentelemetry", "otel", "tracing", "jaeger", "thrift"],
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "opentelemetry-php contributors",
"homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
}
],
"require": {
"php": "^7.4 || ^8.0",
"packaged/thrift": "^0.15.0"
},
"autoload": {
"psr-4": {
"Jaeger\\Thrift\\": "."
}
}
}