dagwick 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dagwick-0.3.0/CHANGELOG.md +238 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/PKG-INFO +51 -5
- {dagwick-0.2.0 → dagwick-0.3.0}/README.md +50 -4
- {dagwick-0.2.0 → dagwick-0.3.0}/SECURITY.md +24 -6
- dagwick-0.3.0/examples/dagwick-pack-example/README.md +28 -0
- dagwick-0.3.0/examples/dagwick-pack-example/tests/test_checks.py +40 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/__init__.py +3 -1
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/acknowledge.py +9 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/api.py +86 -16
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/core.py +63 -11
- dagwick-0.3.0/src/dagwick/halloween.py +795 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/history.py +4 -2
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/plugin.py +8 -0
- dagwick-0.3.0/src/dagwick/settings.py +173 -0
- dagwick-0.3.0/src/dagwick/snow.py +299 -0
- dagwick-0.3.0/src/dagwick/static/dagwick.js +652 -0
- dagwick-0.3.0/src/dagwick/static/icon-dark.svg +1 -0
- dagwick-0.3.0/src/dagwick/static/icon.svg +1 -0
- dagwick-0.3.0/src/dagwick/themes.py +423 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_acknowledge.py +8 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_api.py +93 -0
- dagwick-0.3.0/tests/test_builtin_themes.py +339 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_cli.py +15 -0
- dagwick-0.3.0/tests/test_fleet_review.py +124 -0
- dagwick-0.3.0/tests/test_fuzz_targets.py +53 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_health.py +1 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_history.py +1 -0
- dagwick-0.3.0/tests/test_packs.py +128 -0
- dagwick-0.3.0/tests/test_scoring_settings.py +176 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_settings.py +16 -5
- dagwick-0.3.0/tests/test_themes.py +119 -0
- dagwick-0.3.0/themes/README.md +103 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/package-lock.json +32 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/package.json +2 -0
- dagwick-0.3.0/ui/src/App.tsx +29 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/DagView.tsx +11 -10
- dagwick-0.3.0/ui/src/Dropdown.tsx +151 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/FleetView.tsx +77 -12
- dagwick-0.3.0/ui/src/PageTabs.tsx +43 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/SeasonEffects.tsx +117 -0
- dagwick-0.3.0/ui/src/ThemesView.tsx +314 -0
- dagwick-0.3.0/ui/src/Wick.test.tsx +69 -0
- dagwick-0.3.0/ui/src/Wick.tsx +321 -0
- dagwick-0.3.0/ui/src/WickSkins.tsx +712 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/api.ts +22 -1
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/components.tsx +9 -9
- dagwick-0.3.0/ui/src/contrast.test.ts +50 -0
- dagwick-0.3.0/ui/src/csv.test.ts +63 -0
- dagwick-0.3.0/ui/src/csv.ts +67 -0
- dagwick-0.3.0/ui/src/grades.test.ts +38 -0
- dagwick-0.3.0/ui/src/grades.ts +44 -0
- dagwick-0.3.0/ui/src/scope.test.ts +113 -0
- dagwick-0.3.0/ui/src/scope.ts +99 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/season.test.ts +40 -1
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/season.ts +68 -5
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/styles.ts +258 -59
- dagwick-0.3.0/ui/src/themes.test.ts +132 -0
- dagwick-0.3.0/ui/src/themes.ts +127 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/types.ts +3 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/useSeason.ts +40 -10
- dagwick-0.2.0/CHANGELOG.md +0 -108
- dagwick-0.2.0/src/dagwick/settings.py +0 -54
- dagwick-0.2.0/src/dagwick/static/dagwick.js +0 -451
- dagwick-0.2.0/src/dagwick/static/icon.svg +0 -1
- dagwick-0.2.0/themes/README.md +0 -31
- dagwick-0.2.0/ui/src/App.tsx +0 -14
- dagwick-0.2.0/ui/src/Lamp.tsx +0 -250
- {dagwick-0.2.0 → dagwick-0.3.0}/.gitignore +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/LICENSE +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/pyproject.toml +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/__init__.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/_secrets.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/_sensors.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/_source.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/_util.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/observability.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/ownership.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/performance.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/reliability.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/scheduling.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/security.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/checks/structure.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/cli.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/health.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/src/dagwick/py.typed +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/conftest.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_checks.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_core.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_release_notes.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_secrets.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_sensors.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/tests/test_source_checks.py +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/RunHealth.tsx +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/ScoreHistory.tsx +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/brand.ts +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/health.test.ts +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/history.test.ts +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/src/main.tsx +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/tsconfig.json +0 -0
- {dagwick-0.2.0 → dagwick-0.3.0}/ui/vite.config.ts +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.3.0] - 2026-11-10
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Seasonal themes for all of Airflow** (`themes/`, config only): realistic
|
|
14
|
+
snow, Halloween, Newroz and Kurdish Language Day as plain `[api] theme`
|
|
15
|
+
files for Airflow 3.2+. The scenery is drawn behind the page, stops under
|
|
16
|
+
reduced motion and loads nothing from the network. No plugin code.
|
|
17
|
+
- **Seasonal themes for all of Airflow, built in.** A new Themes tab next to
|
|
18
|
+
Fleet lists them. By default each theme appears on its dates on every Airflow
|
|
19
|
+
page and goes away afterwards, with nothing to set in Airflow's
|
|
20
|
+
configuration. The first theme is Christmas snow (18 December to 2 January):
|
|
21
|
+
snowflakes drift over Airflow, some carried sideways by the wind, snow
|
|
22
|
+
settles on top of cards, and a drift lies along the bottom. The snow is moved
|
|
23
|
+
by the graphics card, so pages stay smooth; clicks go through it, and viewers
|
|
24
|
+
who prefer reduced motion get still snow. Each viewer can switch off "Show
|
|
25
|
+
themes on their dates", and apply or remove any theme whenever they like; the
|
|
26
|
+
change shows at once, without a reload. Choices are saved in their browser,
|
|
27
|
+
and Dagwick still writes nothing to Airflow's database. Any theme the admin
|
|
28
|
+
already set in Airflow is kept.
|
|
29
|
+
- **Halloween theme** (24 October to 1 November): dark bats flit about on
|
|
30
|
+
their own random paths, beating their wings, ghosts drift across Airflow,
|
|
31
|
+
embers rise, a full moon with seas, craters and thin clouds peeks from the
|
|
32
|
+
corner, darkness closes in from the edges, glowing eyes blink in the fog along
|
|
33
|
+
the bottom, a small cobweb hangs in the corner, black gnarled branches lie on
|
|
34
|
+
top of the cards (like the snow at Christmas), and spiders dangle from them.
|
|
35
|
+
Airflow's sidebar, with the user menu, always stays clear of the decorations.
|
|
36
|
+
Switching between themes without a reload clears the old theme first.
|
|
37
|
+
- **The banner follows the theme.** When a seasonal theme is showing, by date
|
|
38
|
+
or applied by the viewer, Dagwick's banner takes the matching seasonal look
|
|
39
|
+
(Wick in a Santa hat with snow at Christmas, a witch hat and pumpkin at
|
|
40
|
+
Halloween), whatever the `seasonal_moods` setting says.
|
|
41
|
+
- **Themes coming soon.** Newroz, Eid, Ramadan, Kurdish Language Day, New
|
|
42
|
+
Year, Dagwick's birthday, Çarşema Sor, Diwali and the Lantern Festival are
|
|
43
|
+
listed on the Themes page as "Coming soon", after Christmas and Halloween.
|
|
44
|
+
They can't be applied until their decorations for all of Airflow are made;
|
|
45
|
+
on their dates Dagwick's banner still dresses up (the seasonal mood), unless
|
|
46
|
+
the viewer turned off "Show themes on their dates": that switch now turns off
|
|
47
|
+
the banner's date-based look too. Eid
|
|
48
|
+
and Ramadan follow the Islamic calendar, from a table of approximate dates
|
|
49
|
+
for 2026-2031.
|
|
50
|
+
- **Sidebar icon in Airflow's style:** a candle outline in the same line style
|
|
51
|
+
and colours as Airflow's own sidebar icons, with a version for dark mode, and
|
|
52
|
+
white while Dagwick's page is open, like Airflow's highlighted items.
|
|
53
|
+
- **Download the fleet as CSV.** A button on the fleet page saves the DAGs
|
|
54
|
+
shown (with the current search and filters) as a CSV file: dag_id, owners,
|
|
55
|
+
tags, paused, score, grade, failing and warning checks, runs and success
|
|
56
|
+
rate over 30 days. It is built in the browser from `/api/fleet`, so it holds
|
|
57
|
+
only the DAGs the user may read. Cells that a spreadsheet would run as a
|
|
58
|
+
formula are written as text.
|
|
59
|
+
- `/api/fleet` includes each DAG's `tags`.
|
|
60
|
+
- **Fleet data in a dashboard** (`docs/dashboards.md`): how to read
|
|
61
|
+
`/dagwick/api/fleet` with an Airflow API token and feed it to Grafana, a
|
|
62
|
+
warehouse or alerts. Dagwick does not add a metrics endpoint or push
|
|
63
|
+
metrics: scrapers can't easily authenticate against Airflow 3, and the
|
|
64
|
+
plugin makes no network calls.
|
|
65
|
+
- **Tune the scoring in `airflow.cfg`.** Three optional `[dagwick]` settings:
|
|
66
|
+
`disabled_checks` leaves checks out of every score, `weights` changes how
|
|
67
|
+
many points a check is worth, and `grades` sets the grade thresholds.
|
|
68
|
+
Invalid values are logged and ignored. The DAG tab, the fleet page and
|
|
69
|
+
`dagwick check` all follow them. See `docs/checks.md`.
|
|
70
|
+
- `/api/checks` shows each check's `default_weight` and whether it is
|
|
71
|
+
`enabled`; `/api/config` includes the grade thresholds.
|
|
72
|
+
- **Check packs.** A guide, "Write a check pack", in `docs/checks.md`, and an
|
|
73
|
+
example pack in `examples/dagwick-pack-example` with one check and its
|
|
74
|
+
tests. The guide says which parts of the check interface are stable.
|
|
75
|
+
- Each check now records which pack it came from: `pack` in `/api/checks` and
|
|
76
|
+
in score reports, and a tag on pack checks in the DAG tab.
|
|
77
|
+
- **Signed releases.** Each release now has a build provenance attestation,
|
|
78
|
+
and its GitHub release carries the wheel, the sdist and their Sigstore
|
|
79
|
+
bundles. See "Verify a release" in the README.
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- **New mascot and icon.** Dagwick's mascot is now Wick, a little flame on a
|
|
84
|
+
candle stamped with a DAG: one more node lights up with every grade, and at F
|
|
85
|
+
the flame is out and only smoke is left. The seasonal moods dress Wick up
|
|
86
|
+
(a bonfire at Newroz, a pumpkin at Halloween, a fanous at Ramadan, a cupcake
|
|
87
|
+
on its birthday, ...). The sidebar icon and the README banner match.
|
|
88
|
+
- `SECURITY.md` links the private reporting form and published advisories,
|
|
89
|
+
and lists every `[dagwick]` setting.
|
|
90
|
+
- **Seasonal moods are on by default** (#35). `seasonal_moods` now defaults to
|
|
91
|
+
`auto`, so Wick dresses up on each holiday's dates with nothing to configure.
|
|
92
|
+
To keep the old behaviour, set `seasonal_moods = off`. Each viewer can still
|
|
93
|
+
hide them with **Hide** on the greeting.
|
|
94
|
+
- **Three new moods** (#35): **Çarşema Sor**, the Yazidi New Year (red spring
|
|
95
|
+
flowers, painted eggs, a flower crown for Wick), **Diwali** (Wick in a clay
|
|
96
|
+
diya, marigold garlands, a row of lit diyas) and the **Lantern Festival**
|
|
97
|
+
(a red-and-gold candle, red lanterns swinging, sky lanterns drifting up).
|
|
98
|
+
Diwali and the Lantern Festival follow lunisolar calendars, so their dates
|
|
99
|
+
are listed per year for 2026–2031. Each also appears on the Themes page
|
|
100
|
+
as "Coming soon". A short festival wins over a longer one it falls in:
|
|
101
|
+
Dagwick's birthday over Diwali 2026, Diwali over Halloween 2027, the Lantern
|
|
102
|
+
Festival over Ramadan 2026.
|
|
103
|
+
- **Smoother mood scenes.** Falling snow and confetti, flying bats, rising
|
|
104
|
+
balloons, embers and letters now move with GPU transforms instead of
|
|
105
|
+
changing their position, so the page isn't laid out again on every frame.
|
|
106
|
+
|
|
107
|
+
### Fixed
|
|
108
|
+
|
|
109
|
+
- Newroz's embers in the banner never rose: Wick's own ember style overrode
|
|
110
|
+
them. They now drift up again.
|
|
111
|
+
- A DAG file with a bare carriage return (`\r`) before a non-ASCII character
|
|
112
|
+
could not be scored on Python 3.12: reading its `# dagwick: ack` comments
|
|
113
|
+
crashed. Such a file is now scored as if it had no ack comments. Found by
|
|
114
|
+
the new fuzz tests.
|
|
115
|
+
- **Phones and a narrow DAG panel.** Below about 440 px the header no longer
|
|
116
|
+
clips the score ring and Wick's speech bubble: both shrink to fit side by
|
|
117
|
+
side. On the fleet page the search box now spans the row below 720 px, as
|
|
118
|
+
intended, instead of staying 260 px wide and pushing the DAG list past the
|
|
119
|
+
edge. Found in the 0.2.0 QA (#34).
|
|
120
|
+
- `/dagwick/api/health` and `/dagwick/api/history` now return 404 for a DAG
|
|
121
|
+
that does not exist, like `/dagwick/api/score`, instead of an empty 200. A
|
|
122
|
+
typo in a script or dashboard now fails loudly (#60).
|
|
123
|
+
- The README now explains that Viewer and User roles need `can read on
|
|
124
|
+
Plugins` (FAB) to see Dagwick's pages, and how to give it (#58).
|
|
125
|
+
- **Text contrast now meets WCAG AA (4.5:1).** The A–D grade badges use darker
|
|
126
|
+
shades so their white letter is readable at small sizes, and small amber text
|
|
127
|
+
in the light theme ("Dagwick", "Next step", "How to fix") uses a darker amber.
|
|
128
|
+
Tab counts and "passed" chips are darker too. Bars and the score ring keep
|
|
129
|
+
their colours (#59).
|
|
130
|
+
- **Themes apply without a hard refresh.** Airflow's `/ui/config` reply now
|
|
131
|
+
says `Cache-Control: no-store` and `Vary: Cookie`, because it depends on the
|
|
132
|
+
viewer's theme cookies: a browser or proxy can no longer keep showing the
|
|
133
|
+
theme from before an Apply or Remove.
|
|
134
|
+
- **Halloween now decorates Airflow's sidebar too:** a dusk glow behind the
|
|
135
|
+
icons, a cobweb in the corner by the logo and a spider letting itself down
|
|
136
|
+
along the edge. Nothing covers the icons or the user menu, and clicks pass
|
|
137
|
+
through.
|
|
138
|
+
|
|
139
|
+
## [0.2.0] - 2026-11-09
|
|
140
|
+
|
|
141
|
+
### Added
|
|
142
|
+
|
|
143
|
+
- **Seasonal moods (experimental, off by default).** During holidays the mascot dresses up and the page
|
|
144
|
+
header gets an animated scene: falling snow at Christmas, bats at Halloween,
|
|
145
|
+
bonfires and govend dancers at Newroz, Kurdish letters on Kurdish Language
|
|
146
|
+
Day, lanterns at Ramadan, kulîçe at Eid, fireworks at New Year. Each mood
|
|
147
|
+
shows a short English greeting. Decoration only: scores never change.
|
|
148
|
+
- One optional, non-secret setting: `[dagwick] seasonal_moods`
|
|
149
|
+
(`off` by default | `auto` | a list of moods). Viewers can also hide moods for themselves.
|
|
150
|
+
- Preview any mood with `?dagwick_mood=<id>`.
|
|
151
|
+
- New check, **File named after the DAG**: warns when a DAG's file is not
|
|
152
|
+
`<dag_id>.py`, so the code is easy to find from the DAG name. Files that
|
|
153
|
+
define several DAGs (DAG factories) are skipped.
|
|
154
|
+
- Checks can take an optional second parameter, `context`, with facts that
|
|
155
|
+
are not on the DAG itself (for example how many DAGs share its file).
|
|
156
|
+
- New checks that read the DAG file's source as Airflow stored it, without
|
|
157
|
+
running it: **No `Variable.get` at parse time** and **Uses current Airflow
|
|
158
|
+
imports** (paths Airflow itself marks as deprecated, with the new location).
|
|
159
|
+
- New check, **Fast to parse**: warns from 5 s and fails from 20 s, using the
|
|
160
|
+
parse time Airflow records for each file.
|
|
161
|
+
- New category, **Performance**.
|
|
162
|
+
- `Context` gains `source` and `parse_seconds`.
|
|
163
|
+
- **Acknowledge a check on purpose.** A `# dagwick: ack <check> -- <reason>`
|
|
164
|
+
comment in the DAG file marks a check the DAG breaks on purpose. It shows
|
|
165
|
+
greyed out with the reason, is left out of the score and of "Most common
|
|
166
|
+
issues", and is counted on the fleet page. Only 8 checks allow it
|
|
167
|
+
(see `docs/checks.md`); a reason is required.
|
|
168
|
+
- New status `ack` in the API; check results gain `ack_reason` and `ack_note`.
|
|
169
|
+
`@check` gains `acknowledgeable` and `ack_hint`.
|
|
170
|
+
- **No `Variable.get` at parse time** also checks the body of `@dag`
|
|
171
|
+
functions, which runs on every parse; `@task` functions inside stay deferred.
|
|
172
|
+
- New check, **No secrets in the DAG file**, in a new **Security** category:
|
|
173
|
+
flags string values assigned to secret-looking names (`password`, `token`,
|
|
174
|
+
`api_key`, `client_secret`, ...), known credential formats (AWS key ids,
|
|
175
|
+
private keys, GitHub and Slack tokens, Slack webhooks, Google API keys) and
|
|
176
|
+
passwords inside connection URIs. Only the line and the kind are shown,
|
|
177
|
+
never the value. It cannot be acknowledged.
|
|
178
|
+
- New check, **Sensors free their worker slot**: warns when a sensor that
|
|
179
|
+
runs in poke mode typically waits a minute or more per run, holding a
|
|
180
|
+
worker slot the whole time. Which tasks are sensors comes from the
|
|
181
|
+
serialized DAG, how each one waits from the DAG source (`mode`,
|
|
182
|
+
`deferrable`, `*Async` classes, `default_args`, `@task.sensor`), and how
|
|
183
|
+
long it waits from the last 30 days of runs. Rescheduled sensors are proven
|
|
184
|
+
by their `task_reschedule` rows. When the evidence is unclear the check
|
|
185
|
+
skips instead of guessing. It can be acknowledged with a reason.
|
|
186
|
+
- `Context` gains `sensor_tasks`, `sensor_runs` and `default_deferrable`.
|
|
187
|
+
- **Run health** on the DAG tab, next to the score but not part of it: share
|
|
188
|
+
of runs that succeeded, share of tasks that needed a retry, the typical
|
|
189
|
+
run time with its trend (last 7 days against the rest of the window) and
|
|
190
|
+
the last run, all over the last 30 days. The fleet page shows each DAG's
|
|
191
|
+
success rate. Read from the runs Airflow already records; nothing is stored.
|
|
192
|
+
- New endpoint `GET /dagwick/api/health?dag_id=...`, behind the same DAG
|
|
193
|
+
permission as `/api/score`.
|
|
194
|
+
- **Score history** on the DAG tab: the score of each of the last 20 DAG
|
|
195
|
+
versions, re-scored from the serialized DAG and source code Airflow keeps
|
|
196
|
+
for every version, with which checks started or stopped passing at each
|
|
197
|
+
step. Nothing is stored by Dagwick; each version's score is cached in
|
|
198
|
+
memory until that version's DAG or source changes (Airflow updates the
|
|
199
|
+
newest version in place until the DAG runs again). Only code checks
|
|
200
|
+
count (parse time and other run-time facts describe the present, not past
|
|
201
|
+
versions).
|
|
202
|
+
- New endpoint `GET /dagwick/api/history?dag_id=...`, behind the same DAG
|
|
203
|
+
permission as `/api/score`.
|
|
204
|
+
- **`dagwick check` command** and a **pre-commit hook**: grade DAG files
|
|
205
|
+
before they are merged, with the same checks as the UI (acknowledgements,
|
|
206
|
+
source checks and parse time included), and exit with status 1 below
|
|
207
|
+
`--min-grade`, or 2 when a file fails to load. `--json` prints the reports.
|
|
208
|
+
It imports the DAG files, so it is meant for developer machines and CI; the
|
|
209
|
+
plugin itself still never runs DAG code.
|
|
210
|
+
|
|
211
|
+
### Fixed
|
|
212
|
+
|
|
213
|
+
- Fleet headline no longer contradicts the stats: it describes the average
|
|
214
|
+
grade and then states how many DAGs need care.
|
|
215
|
+
- "need care" now counts grades C to F, so it and "healthy (A–B)" add up to
|
|
216
|
+
the number of DAGs.
|
|
217
|
+
- Layout follows the width Dagwick actually has (container queries), so the
|
|
218
|
+
DAG tab inside Airflow's split panel gets the narrow layout.
|
|
219
|
+
- Narrow screens: grade labels are no longer cut off, the lamp and score ring
|
|
220
|
+
sit side by side, and the fleet's "Most common issues" moves below the list.
|
|
221
|
+
- Category cards no longer leave one card alone on the last row.
|
|
222
|
+
- Every failing check opens with its fix by default.
|
|
223
|
+
- On screens wider than 1440 px the page is centered instead of sticking to
|
|
224
|
+
the left with empty space on the right.
|
|
225
|
+
|
|
226
|
+
## [0.1.0] - 2026-11-08
|
|
227
|
+
|
|
228
|
+
### Added
|
|
229
|
+
|
|
230
|
+
- **Dagwick tab** on every DAG page: a score from 0 to 100, a grade from A to F,
|
|
231
|
+
a lantern mascot, the next step to the next grade, the affected tasks, and a
|
|
232
|
+
fix with a copyable code example for every check that does not pass.
|
|
233
|
+
- **Fleet page** in the Airflow sidebar: every DAG the user can read, ranked by
|
|
234
|
+
score, with grade filters, search, sort, and the most common issues.
|
|
235
|
+
- 14 built-in checks covering reliability, observability, scheduling,
|
|
236
|
+
ownership and structure.
|
|
237
|
+
- `dagwick.checks` entry point so other packages can add or override checks.
|
|
238
|
+
- Scores reuse Airflow's own permission checks and are cached per DAG version.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: dagwick
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: The wick that keeps your DAGs lit: DAG quality scores, a fleet view, and fixes you can act on, inside the Airflow 3 UI.
|
|
5
5
|
Project-URL: Homepage, https://github.com/ardalan-jalal/dagwick
|
|
6
6
|
Project-URL: Repository, https://github.com/ardalan-jalal/dagwick
|
|
@@ -31,8 +31,12 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
|
|
32
32
|
# Dagwick
|
|
33
33
|
|
|
34
|
+
[](https://pypi.org/project/dagwick/)  [](https://github.com/ardalan-jalal/dagwick/actions/workflows/ci.yml) [](https://github.com/ardalan-jalal/dagwick/blob/main/LICENSE) [](https://scorecard.dev/viewer/?uri=github.com/ardalan-jalal/dagwick) [](https://www.bestpractices.dev/projects/16521)
|
|
35
|
+
|
|
34
36
|

|
|
35
37
|
|
|
38
|
+

|
|
39
|
+
|
|
36
40
|
## Setup
|
|
37
41
|
|
|
38
42
|
**1. Install** it where Airflow runs:
|
|
@@ -50,7 +54,9 @@ Using Docker? Add `dagwick` to your Airflow image's `requirements.txt`.
|
|
|
50
54
|
- a **Dagwick** tab on every DAG page, and
|
|
51
55
|
- a **Dagwick** page in the sidebar that grades all your DAGs.
|
|
52
56
|
|
|
53
|
-
That's it. There is nothing to configure.
|
|
57
|
+
That's it. There is nothing to configure. If you want to, you can turn checks
|
|
58
|
+
off, change their weights or move the grade thresholds in `airflow.cfg`
|
|
59
|
+
([tune the scoring](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md#tune-the-scoring)).
|
|
54
60
|
|
|
55
61
|
## What you get
|
|
56
62
|
|
|
@@ -66,14 +72,21 @@ That's it. There is nothing to configure.
|
|
|
66
72
|
- **Score history:** the score of each of the last 20 versions of a DAG, and
|
|
67
73
|
which checks started or stopped passing at each step.
|
|
68
74
|
- **A fleet page** that grades all the DAGs you can see and shows the most
|
|
69
|
-
common issues.
|
|
75
|
+
common issues. **Download CSV** saves the DAGs shown (dag_id, owners, tags,
|
|
76
|
+
score, grade, failing and warning checks, runs and success rate over 30
|
|
77
|
+
days). The file is built in your browser from what you are allowed to see.
|
|
78
|
+
To put the same data in a dashboard, see
|
|
79
|
+
[Fleet data in a dashboard](https://github.com/ardalan-jalal/dagwick/blob/main/docs/dashboards.md).
|
|
70
80
|
- **`dagwick check` and a pre-commit hook** to grade DAG files before they are
|
|
71
81
|
merged. See [Check DAGs before they are merged](#check-dags-before-they-are-merged).
|
|
72
82
|
- **Break a check on purpose, with a reason.** Some DAGs need `catchup=True`
|
|
73
83
|
or no retries. See [Acknowledge a check on purpose](#acknowledge-a-check-on-purpose).
|
|
84
|
+
- **Your own rules as a check pack:** a separate package that adds checks
|
|
85
|
+
through an entry point. See
|
|
86
|
+
[Write a check pack](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md#write-a-check-pack).
|
|
74
87
|
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
Wick, the little flame, dresses up for holidays like Newroz, Eid, Çarşema Sor,
|
|
89
|
+
Diwali, Christmas and Halloween ([seasonal moods](https://github.com/ardalan-jalal/dagwick/blob/main/docs/moods.md)).
|
|
77
90
|
|
|
78
91
|

|
|
79
92
|
|
|
@@ -168,6 +181,38 @@ Dagwick has no dependencies of its own, so installing it never changes your
|
|
|
168
181
|
other packages. It is read-only and only shows each user the DAGs they can
|
|
169
182
|
already see.
|
|
170
183
|
|
|
184
|
+
### Permissions
|
|
185
|
+
|
|
186
|
+
Airflow only shows plugin pages to users who may read the list of plugins.
|
|
187
|
+
With the FAB auth manager (`apache-airflow-providers-fab`), the **Admin** and
|
|
188
|
+
**Op** roles can do that, but **Viewer** and **User** cannot. For them the
|
|
189
|
+
Dagwick tab and sidebar page are missing, and `/plugin/dagwick-fleet` shows
|
|
190
|
+
Airflow's "page not found". Dagwick is not broken; give the role that
|
|
191
|
+
permission:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
airflow roles add-perms Viewer -a can_read -r Plugins
|
|
195
|
+
airflow roles add-perms User -a can_read -r Plugins
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Users still only see the DAGs they may read. With another auth manager, give
|
|
199
|
+
the same users read access to plugins in that manager.
|
|
200
|
+
|
|
201
|
+
## Verify a release
|
|
202
|
+
|
|
203
|
+
From 0.3.0, every release is built and signed by the release workflow in this
|
|
204
|
+
repository. To check that the wheel you install is the one it built:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
pip download dagwick==0.3.0 --no-deps -d dagwick-download
|
|
208
|
+
gh attestation verify dagwick-download/*.whl -R ardalan-jalal/dagwick
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The GitHub release also carries a Sigstore bundle (`.sigstore.json`) for the
|
|
212
|
+
wheel and the sdist. See
|
|
213
|
+
[Releasing](https://github.com/ardalan-jalal/dagwick/blob/main/RELEASING.md#verify-a-release)
|
|
214
|
+
for how to check those.
|
|
215
|
+
|
|
171
216
|
## Remove
|
|
172
217
|
|
|
173
218
|
```bash
|
|
@@ -179,6 +224,7 @@ Then restart the api-server.
|
|
|
179
224
|
## More
|
|
180
225
|
|
|
181
226
|
- [Seasonal moods, and how to turn them off](https://github.com/ardalan-jalal/dagwick/blob/main/docs/moods.md)
|
|
227
|
+
- [Seasonal themes for all of Airflow, config only](https://github.com/ardalan-jalal/dagwick/blob/main/themes/README.md)
|
|
182
228
|
- [What it checks, and how to add your own checks](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md)
|
|
183
229
|
- [Roadmap](https://github.com/ardalan-jalal/dagwick/blob/main/ROADMAP.md)
|
|
184
230
|
- [Security](https://github.com/ardalan-jalal/dagwick/blob/main/SECURITY.md) · [Contributing](https://github.com/ardalan-jalal/dagwick/blob/main/CONTRIBUTING.md) · [Changelog](https://github.com/ardalan-jalal/dagwick/blob/main/CHANGELOG.md) · [Releasing](https://github.com/ardalan-jalal/dagwick/blob/main/RELEASING.md)
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Dagwick
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/dagwick/)  [](https://github.com/ardalan-jalal/dagwick/actions/workflows/ci.yml) [](https://github.com/ardalan-jalal/dagwick/blob/main/LICENSE) [](https://scorecard.dev/viewer/?uri=github.com/ardalan-jalal/dagwick) [](https://www.bestpractices.dev/projects/16521)
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
|
|
7
|
+

|
|
8
|
+
|
|
5
9
|
## Setup
|
|
6
10
|
|
|
7
11
|
**1. Install** it where Airflow runs:
|
|
@@ -19,7 +23,9 @@ Using Docker? Add `dagwick` to your Airflow image's `requirements.txt`.
|
|
|
19
23
|
- a **Dagwick** tab on every DAG page, and
|
|
20
24
|
- a **Dagwick** page in the sidebar that grades all your DAGs.
|
|
21
25
|
|
|
22
|
-
That's it. There is nothing to configure.
|
|
26
|
+
That's it. There is nothing to configure. If you want to, you can turn checks
|
|
27
|
+
off, change their weights or move the grade thresholds in `airflow.cfg`
|
|
28
|
+
([tune the scoring](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md#tune-the-scoring)).
|
|
23
29
|
|
|
24
30
|
## What you get
|
|
25
31
|
|
|
@@ -35,14 +41,21 @@ That's it. There is nothing to configure.
|
|
|
35
41
|
- **Score history:** the score of each of the last 20 versions of a DAG, and
|
|
36
42
|
which checks started or stopped passing at each step.
|
|
37
43
|
- **A fleet page** that grades all the DAGs you can see and shows the most
|
|
38
|
-
common issues.
|
|
44
|
+
common issues. **Download CSV** saves the DAGs shown (dag_id, owners, tags,
|
|
45
|
+
score, grade, failing and warning checks, runs and success rate over 30
|
|
46
|
+
days). The file is built in your browser from what you are allowed to see.
|
|
47
|
+
To put the same data in a dashboard, see
|
|
48
|
+
[Fleet data in a dashboard](https://github.com/ardalan-jalal/dagwick/blob/main/docs/dashboards.md).
|
|
39
49
|
- **`dagwick check` and a pre-commit hook** to grade DAG files before they are
|
|
40
50
|
merged. See [Check DAGs before they are merged](#check-dags-before-they-are-merged).
|
|
41
51
|
- **Break a check on purpose, with a reason.** Some DAGs need `catchup=True`
|
|
42
52
|
or no retries. See [Acknowledge a check on purpose](#acknowledge-a-check-on-purpose).
|
|
53
|
+
- **Your own rules as a check pack:** a separate package that adds checks
|
|
54
|
+
through an entry point. See
|
|
55
|
+
[Write a check pack](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md#write-a-check-pack).
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
Wick, the little flame, dresses up for holidays like Newroz, Eid, Çarşema Sor,
|
|
58
|
+
Diwali, Christmas and Halloween ([seasonal moods](https://github.com/ardalan-jalal/dagwick/blob/main/docs/moods.md)).
|
|
46
59
|
|
|
47
60
|

|
|
48
61
|
|
|
@@ -137,6 +150,38 @@ Dagwick has no dependencies of its own, so installing it never changes your
|
|
|
137
150
|
other packages. It is read-only and only shows each user the DAGs they can
|
|
138
151
|
already see.
|
|
139
152
|
|
|
153
|
+
### Permissions
|
|
154
|
+
|
|
155
|
+
Airflow only shows plugin pages to users who may read the list of plugins.
|
|
156
|
+
With the FAB auth manager (`apache-airflow-providers-fab`), the **Admin** and
|
|
157
|
+
**Op** roles can do that, but **Viewer** and **User** cannot. For them the
|
|
158
|
+
Dagwick tab and sidebar page are missing, and `/plugin/dagwick-fleet` shows
|
|
159
|
+
Airflow's "page not found". Dagwick is not broken; give the role that
|
|
160
|
+
permission:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
airflow roles add-perms Viewer -a can_read -r Plugins
|
|
164
|
+
airflow roles add-perms User -a can_read -r Plugins
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Users still only see the DAGs they may read. With another auth manager, give
|
|
168
|
+
the same users read access to plugins in that manager.
|
|
169
|
+
|
|
170
|
+
## Verify a release
|
|
171
|
+
|
|
172
|
+
From 0.3.0, every release is built and signed by the release workflow in this
|
|
173
|
+
repository. To check that the wheel you install is the one it built:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
pip download dagwick==0.3.0 --no-deps -d dagwick-download
|
|
177
|
+
gh attestation verify dagwick-download/*.whl -R ardalan-jalal/dagwick
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The GitHub release also carries a Sigstore bundle (`.sigstore.json`) for the
|
|
181
|
+
wheel and the sdist. See
|
|
182
|
+
[Releasing](https://github.com/ardalan-jalal/dagwick/blob/main/RELEASING.md#verify-a-release)
|
|
183
|
+
for how to check those.
|
|
184
|
+
|
|
140
185
|
## Remove
|
|
141
186
|
|
|
142
187
|
```bash
|
|
@@ -148,6 +193,7 @@ Then restart the api-server.
|
|
|
148
193
|
## More
|
|
149
194
|
|
|
150
195
|
- [Seasonal moods, and how to turn them off](https://github.com/ardalan-jalal/dagwick/blob/main/docs/moods.md)
|
|
196
|
+
- [Seasonal themes for all of Airflow, config only](https://github.com/ardalan-jalal/dagwick/blob/main/themes/README.md)
|
|
151
197
|
- [What it checks, and how to add your own checks](https://github.com/ardalan-jalal/dagwick/blob/main/docs/checks.md)
|
|
152
198
|
- [Roadmap](https://github.com/ardalan-jalal/dagwick/blob/main/ROADMAP.md)
|
|
153
199
|
- [Security](https://github.com/ardalan-jalal/dagwick/blob/main/SECURITY.md) · [Contributing](https://github.com/ardalan-jalal/dagwick/blob/main/CONTRIBUTING.md) · [Changelog](https://github.com/ardalan-jalal/dagwick/blob/main/CHANGELOG.md) · [Releasing](https://github.com/ardalan-jalal/dagwick/blob/main/RELEASING.md)
|
|
@@ -3,11 +3,25 @@
|
|
|
3
3
|
## Reporting a vulnerability
|
|
4
4
|
|
|
5
5
|
Please **do not open a public issue** for security problems. Report them
|
|
6
|
-
privately
|
|
7
|
-
**Report a vulnerability**.
|
|
6
|
+
privately with GitHub's form:
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
**<https://github.com/ardalan-jalal/dagwick/security/advisories/new>**
|
|
9
|
+
|
|
10
|
+
(It is also on this repository's **Security** tab, under **Report a
|
|
11
|
+
vulnerability**.) Only the maintainers can see the report.
|
|
12
|
+
|
|
13
|
+
Please include the Dagwick and Airflow versions, what an attacker can do, and
|
|
14
|
+
the steps to reproduce it.
|
|
15
|
+
|
|
16
|
+
What happens next:
|
|
17
|
+
|
|
18
|
+
- We acknowledge the report within **3 working days** and keep you updated
|
|
19
|
+
until it is fixed.
|
|
20
|
+
- We agree a disclosure date with you once a fix is ready.
|
|
21
|
+
- The fix is announced in a **GitHub Security Advisory**, with a CVE when one
|
|
22
|
+
applies, and in the release notes. We credit you unless you prefer not.
|
|
23
|
+
|
|
24
|
+
Published advisories: <https://github.com/ardalan-jalal/dagwick/security/advisories>
|
|
11
25
|
|
|
12
26
|
## Supported versions
|
|
13
27
|
|
|
@@ -25,8 +39,9 @@ surface beyond what Airflow already exposes:
|
|
|
25
39
|
never writes to the database, never executes DAG code, and never makes network
|
|
26
40
|
calls.
|
|
27
41
|
- **No secrets.** Dagwick reads no Airflow Variables, Connections or
|
|
28
|
-
credentials. Its
|
|
29
|
-
cosmetic
|
|
42
|
+
credentials. Its settings in `airflow.cfg` are all optional and none of them
|
|
43
|
+
is secret: `[dagwick] seasonal_moods` (cosmetic), `disabled_checks`,
|
|
44
|
+
`weights` and `grades` (how DAGs are scored).
|
|
30
45
|
- **Safe errors.** Error responses contain only a generic message and a
|
|
31
46
|
reference id. Details go to the server log, never to the browser.
|
|
32
47
|
- **Same origin only.** No CORS headers are added.
|
|
@@ -36,3 +51,6 @@ surface beyond what Airflow already exposes:
|
|
|
36
51
|
Airflow already provides. It loads nothing from a CDN, uses no
|
|
37
52
|
`innerHTML`, and stores nothing in `localStorage`.
|
|
38
53
|
- **No runtime dependencies.** The package declares no dependencies of its own.
|
|
54
|
+
- **Signed releases.** Releases are published from GitHub Actions with PyPI
|
|
55
|
+
Trusted Publishing (no stored token), with a build provenance attestation
|
|
56
|
+
and Sigstore signatures. See "Verify a release" in `RELEASING.md`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Example Dagwick check pack
|
|
2
|
+
|
|
3
|
+
A check pack adds your own rules to [Dagwick](https://github.com/ardalan-jalal/dagwick)
|
|
4
|
+
without changing Dagwick. This one has a single check, **Has a team tag**.
|
|
5
|
+
It is an example and is not published: copy this folder to start your own pack.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
pyproject.toml the dagwick.checks entry point
|
|
9
|
+
src/dagwick_pack_example/checks.py the check
|
|
10
|
+
tests/test_checks.py tests against a serialized DAG
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install it next to Dagwick in your Airflow environment and restart the
|
|
14
|
+
api-server:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install ./examples/dagwick-pack-example
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The check then shows up on every DAG, tagged with the pack's name.
|
|
21
|
+
|
|
22
|
+
Run its tests from this folder in an environment that has Airflow and Dagwick:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pytest
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The guide is in [docs/checks.md](../../docs/checks.md#write-a-check-pack).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Test checks against the DAG as Dagwick sees it: serialized, then read back."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from airflow.sdk import DAG
|
|
7
|
+
|
|
8
|
+
from dagwick import Status, score_dag
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
from airflow.serialization.serialized_objects import DagSerialization
|
|
12
|
+
except ImportError: # older Airflow 3.x
|
|
13
|
+
from airflow.serialization.serialized_objects import SerializedDAG as DagSerialization
|
|
14
|
+
|
|
15
|
+
from dagwick_pack_example.checks import team_tag
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def serialized(**kwargs):
|
|
19
|
+
with DAG("example", schedule=None, **kwargs) as dag:
|
|
20
|
+
pass
|
|
21
|
+
return DagSerialization.from_dict(DagSerialization.to_dict(dag))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@pytest.mark.parametrize(
|
|
25
|
+
("tags", "status"),
|
|
26
|
+
[
|
|
27
|
+
(["team:data", "finance"], Status.PASS),
|
|
28
|
+
(["team:data", "team:ml"], Status.WARN),
|
|
29
|
+
(["finance", "team:"], Status.FAIL),
|
|
30
|
+
([], Status.FAIL),
|
|
31
|
+
],
|
|
32
|
+
)
|
|
33
|
+
def test_team_tag(tags, status):
|
|
34
|
+
assert team_tag(serialized(tags=tags)).status == status
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_registered_with_dagwick():
|
|
38
|
+
report = score_dag(serialized(tags=["team:data"]))
|
|
39
|
+
(result,) = [c for c in report["checks"] if c["id"] == "example_team_tag"]
|
|
40
|
+
assert result["status"] == "pass"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Dagwick: the wick that keeps your Airflow DAGs lit."""
|
|
2
2
|
|
|
3
|
+
# The check interface for check packs: check, Finding, Status, Category, Context.
|
|
4
|
+
# score_dag is exported for scripts and tests; its report layout is not yet stable.
|
|
3
5
|
from dagwick.core import Category, Context, Finding, Status, check, score_dag
|
|
4
6
|
|
|
5
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.3.0"
|
|
6
8
|
__all__ = ["Category", "Context", "Finding", "Status", "__version__", "check", "score_dag"]
|
|
@@ -12,6 +12,7 @@ from __future__ import annotations
|
|
|
12
12
|
|
|
13
13
|
import functools
|
|
14
14
|
import io
|
|
15
|
+
import logging
|
|
15
16
|
import re
|
|
16
17
|
import tokenize
|
|
17
18
|
from collections.abc import Mapping
|
|
@@ -24,6 +25,8 @@ _ACK = re.compile(
|
|
|
24
25
|
re.IGNORECASE,
|
|
25
26
|
)
|
|
26
27
|
|
|
28
|
+
log = logging.getLogger(__name__)
|
|
29
|
+
|
|
27
30
|
_NONE: Mapping[str, str] = MappingProxyType({})
|
|
28
31
|
|
|
29
32
|
|
|
@@ -45,4 +48,10 @@ def acknowledgements(source: str) -> Mapping[str, str]:
|
|
|
45
48
|
seen.append(reason)
|
|
46
49
|
except (tokenize.TokenError, SyntaxError):
|
|
47
50
|
return _NONE
|
|
51
|
+
except Exception: # noqa: BLE001
|
|
52
|
+
# tokenize itself can fail on odd text, for example a bare "\r" before a
|
|
53
|
+
# non-ASCII character on Python 3.12 (UnicodeDecodeError, SystemError).
|
|
54
|
+
# A comment must never stop a DAG from being scored.
|
|
55
|
+
log.debug("dagwick: could not read ack comments", exc_info=True)
|
|
56
|
+
return _NONE
|
|
48
57
|
return MappingProxyType({k: "; ".join(v) for k, v in reasons.items()})
|