Skip to content

Commit 3c2e9a6

Browse files
committed
feat: allow extending validation using project Makefile
(See)[./adrs/0001-extending-validation.md] for why. Summary: Allow projects to define their own Makefile target `validate`. If the Makefile exists in the project using the devtool, then after devtool's validate has run, run the project's validate target.
1 parent e54c786 commit 3c2e9a6

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

catalog-info.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
description: Devtools and other useful container images
77
annotations:
88
backstage.io/techdocs-ref: dir:.
9+
backstage.io/adr-location: docs/adrs
910
github.com/project-slug: coopnorge/engineering-docker-images
1011
spec:
1112
owner: engineering
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Allowing extending validation using project Makefile
2+
3+
- Status: draft
4+
- Decider:
5+
- Arun Poudel <[email protected]>
6+
- Data 2023-12-05
7+
8+
## Context and Problem Statement
9+
10+
Some projects want more validation than what is provided by the default
11+
by devtools image.
12+
13+
For example: a project using `dbt` would want to run `dbt test` as part of
14+
the validation process.
15+
16+
The current implementation limits us to only run validations defined in
17+
specific devtool's Makefile.
18+
19+
## Decision Drivers
20+
21+
- We want to allow projects to define their own validation steps in addition
22+
to the ones provided by the devtools image.
23+
24+
## Considered Options
25+
26+
- Allow projects to define their own validation steps in their Makefile.
27+
- Embed those validations in devtools itself.
28+
29+
## Decision Outcome
30+
31+
Chosen option: "Allow projects to define their own validation steps in their
32+
Makefile", because:
33+
34+
- It is easier to maintain and extend.
35+
- It is easier to understand.
36+
- It allows projects to define their own validation steps without having to
37+
make upstream contributions to devtools which might not be relevant to other
38+
projects.
39+
40+
The way this works is, validate first runs the validations defined in the
41+
devtools, and after that if Makefile exists in the project root, it runs
42+
the `validate` target defined in the Makefile. If the target returns an error
43+
(exit code != 0, this might happen when the target is missing as well), the validation fails.

0 commit comments

Comments
 (0)