Skip to content

Commit cef8a81

Browse files
DoDiODevCopilot
andcommitted
docs: update AGENTS.md, bump sqlglot, restore backend/Dockerfile from main
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e1ad6ae commit cef8a81

3 files changed

Lines changed: 21 additions & 75 deletions

File tree

AGENTS.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Apache DevLake is a dev data platform that ingests data from DevOps tools (GitHu
3131
- **backend/python/**: Python plugin framework via RPC
3232
- **config-ui/**: React frontend (TypeScript, Vite, Ant Design)
3333
- **grafana/**: Dashboard definitions
34+
- **e2e/**: Top-level Playwright end-to-end tests (`qdev-full-flow.spec.ts`, `render-smoke.spec.ts`)
3435

3536
## Plugin Development (Go)
3637

@@ -89,6 +90,13 @@ var CollectIssuesMeta = plugin.SubTaskMeta{
8990
- Use `helper.NewStatefulApiCollector` for incremental collection with time-based bookmarking
9091
- See [backend/plugins/gitlab/tasks/issue_collector.go](backend/plugins/gitlab/tasks/issue_collector.go)
9192

93+
### Custom Plugin: q_dev (AWS Q Developer)
94+
[backend/plugins/q_dev/](backend/plugins/q_dev/) is a fork-specific plugin that collects Amazon Q Developer
95+
usage metrics from **AWS S3** (not a REST API). Scoping is S3 prefix-based (`QDevS3Slice`/`QDevS3FileMeta`
96+
with year/month partitioning) rather than domain-layer scopes. Models: `QDevConnection`, `QDevUserData`,
97+
`QDevUserReport`, `QDevChatLog`, `QDevCompletionLog`. It implements `PluginInit` and
98+
`DataSourcePluginBlueprintV200`. A LocalStack S3 mock can be used for local/E2E runs.
99+
92100
### Migration Scripts
93101
- Located in `models/migrationscripts/`
94102
- Register all scripts in `register.go`'s `All()` function
@@ -117,11 +125,14 @@ make e2e-test-go-plugins # Run E2E tests for Go plugins only
117125

118126
### Running Locally
119127
```bash
120-
docker-compose -f docker-compose-dev.yml up mysql grafana # Start deps
128+
# MySQL stack (docker-compose-dev.yml does NOT exist - use the DB-specific files)
129+
docker-compose -f docker-compose-dev-mysql.yml up mysql grafana # MySQL + Grafana
130+
docker-compose -f docker-compose-dev-postgresql.yml up postgres grafana # or PostgreSQL + Grafana
121131
make dev # Run server on :8080
122132
cd config-ui && yarn && yarn start # UI on :4000
123133
```
124134

135+
125136
## Testing
126137

127138
### Unit Tests
@@ -130,6 +141,10 @@ Place `*_test.go` files alongside source. Use mocks from `backend/mocks/`. Mocks
130141
### E2E Tests for Plugins
131142
Use CSV fixtures in `e2e/` directory. See [backend/test/helper/](backend/test/helper/) for the Go test client that can spin up an in-memory DevLake instance.
132143

144+
### Playwright E2E (full flow)
145+
The top-level [e2e/](e2e/) directory holds Playwright browser tests against a running stack. Open the
146+
report with `cd e2e && npx playwright show-report`.
147+
133148
### Integration Testing
134149
```go
135150
helper.ConnectLocalServer(t, &helper.LocalClientConfig{
@@ -145,6 +160,7 @@ Run `make migration-script-lint` from `backend/` to validate all migration scrip
145160

146161
## Python Plugins
147162
Located in `backend/python/plugins/`. Use Poetry for dependencies. See [backend/python/README.md](backend/python/README.md).
163+
Python is pinned to **3.11** (Pydantic v1 + `dbt-mysql` 1.7 block 3.12+).
148164

149165
## Code Conventions
150166
- Tool model table names: `_tool_<plugin>_<entity>` (e.g., `_tool_gitlab_issues`)

backend/Dockerfile

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN if [ "$(arch)" != "x86_64" ] ; then \
5050
fi
5151

5252
RUN go install github.com/vektra/mockery/v2@v2.53.6
53-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
53+
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.1
5454

5555
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
5656
COPY --from=debian-amd64 /usr/lib/x86_64-linux-gnu /rootfs-amd64/usr/lib/x86_64-linux-gnu
@@ -113,7 +113,7 @@ RUN cd /usr/local/deps/target/lib && \
113113
done
114114

115115

116-
FROM python:3.11-slim-bookworm as base
116+
FROM python:3.9-slim-bookworm as base
117117

118118
RUN apt-get update && \
119119
apt-get install -y python3-dev python3-pip tar pkg-config curl libssh2-1 zlib1g libffi-dev default-libmysqlclient-dev libpq-dev tini git openssh-client corkscrew && \
@@ -181,74 +181,4 @@ USER devlake
181181
#add tini, prevent zombie process
182182
ENTRYPOINT ["/usr/bin/tini", "--"]
183183

184-
CMD ["lake"] libssh2-1-dev \
185-
libssl-dev \
186-
zlib1g-dev
187-
188-
# Install libgit2 for native platform only
189-
RUN mkdir -p /tmp/build && cd /tmp/build && \
190-
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.3.0.tar.gz -O - | tar -xz && \
191-
cd libgit2-1.3.0 && \
192-
mkdir build && cd build && \
193-
cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local && \
194-
make -j$(nproc) install && \
195-
ldconfig
196-
197-
RUN go install github.com/vektra/mockery/v2@v2.53.6
198-
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
199-
200-
WORKDIR /app
201-
202-
# Cache Go module downloads in a separate layer (only re-runs when go.mod/go.sum change)
203-
COPY go.mod go.sum ./
204-
RUN --mount=type=cache,target=/go/pkg/mod \
205-
go mod download
206-
207-
# Now copy the rest of the source
208-
COPY . /app
209-
ENV GOBIN=/app/bin
210-
211-
ARG TAG=
212-
ARG SHA=
213-
214-
# Generate mocks and swagger (use build cache to speed up swag)
215-
RUN --mount=type=cache,target=/root/.cache/go-build \
216-
--mount=type=cache,target=/go/pkg/mod \
217-
make mock
218-
RUN --mount=type=cache,target=/root/.cache/go-build \
219-
--mount=type=cache,target=/go/pkg/mod \
220-
make swag
221-
222-
# Build plugins (parallel, with persistent Go build cache)
223-
RUN --mount=type=cache,target=/root/.cache/go-build \
224-
--mount=type=cache,target=/go/pkg/mod \
225-
make build-plugin
226-
227-
# Build server
228-
RUN --mount=type=cache,target=/root/.cache/go-build \
229-
--mount=type=cache,target=/go/pkg/mod \
230-
VERSION=${TAG}@${SHA} make build-server
231-
232-
FROM debian:bookworm-slim
233-
234-
RUN apt-get update && apt-get install -y \
235-
libssh2-1 \
236-
libssl3 \
237-
ca-certificates \
238-
&& rm -rf /var/lib/apt/lists/*
239-
240-
# Copy libgit2
241-
COPY --from=builder /usr/local/lib/libgit2.so* /usr/local/lib/
242-
RUN ldconfig
243-
244-
WORKDIR /app
245-
246-
COPY --from=builder /app/bin ./bin
247-
248-
# Create empty python plugins dir to avoid startup error
249-
RUN mkdir -p python/plugins
250-
251-
ENV PORT=8080
252-
EXPOSE 8080
253-
254-
CMD ["./bin/lake"]
184+
CMD ["lake"]

grafana/scripts/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sqlglot==30.11.0
1+
sqlglot==30.12.0

0 commit comments

Comments
 (0)