@afix-ci/cli-linux-x64 0.1.0-rc.5 → 0.1.0-rc.52
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.
- package/README.md +105 -0
- package/cli +0 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,3 +1,108 @@
|
|
|
1
1
|
# afix
|
|
2
2
|
|
|
3
3
|
A simple tool for running scripts and correcting their outputs
|
|
4
|
+
|
|
5
|
+
By default, `afix run` requires a clean repository before it can create
|
|
6
|
+
commits. If a validator mutates repository files, afix preserves those changes
|
|
7
|
+
in a dedicated `afix-validator(...)` commit before any fixer runs. Fixer
|
|
8
|
+
commits therefore contain only changes made after the validator commit.
|
|
9
|
+
`--no-commit` rejects validator mutations because their provenance cannot be
|
|
10
|
+
isolated without commits. Dry runs likewise never create validator commits.
|
|
11
|
+
|
|
12
|
+
## Prepare a pull request
|
|
13
|
+
|
|
14
|
+
`afix prepare-pr` updates the current branch with the selected remote's
|
|
15
|
+
advertised default branch, resolves configured smart-merge conflicts, runs
|
|
16
|
+
repository setup and the normal afix fix loop, then submits the result. The
|
|
17
|
+
working tree must be clean and HEAD must be attached to a local branch.
|
|
18
|
+
`--forge` and `--submit-method` are required:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
afix prepare-pr \
|
|
22
|
+
--forge github \
|
|
23
|
+
--submit-method dependent-pr \
|
|
24
|
+
--git-remote origin
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
By default, preparation mutates the current checkout. Use `--worktree` to
|
|
28
|
+
prepare on a new afix-prefixed branch in a unique sibling worktree, leaving the
|
|
29
|
+
current checkout unchanged:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
afix prepare-pr --worktree \
|
|
33
|
+
--forge github \
|
|
34
|
+
--submit-method dependent-pr
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Add `--swap-branch` when the submitted branch must retain the current branch
|
|
38
|
+
name. This option requires `--worktree`: the host checkout moves to
|
|
39
|
+
`<current-branch>-pre-pr-backup`, while the submission worktree checks out the
|
|
40
|
+
original branch without changing its upstream tracking configuration.
|
|
41
|
+
|
|
42
|
+
Failures before submission do not push or open a pull request. In worktree
|
|
43
|
+
modes, the prepared checkout is retained; failures print its path for
|
|
44
|
+
inspection. Swap setup is transactional, but after setup succeeds its backup
|
|
45
|
+
branch is intentionally retained.
|
|
46
|
+
|
|
47
|
+
### Repository preparation commands
|
|
48
|
+
|
|
49
|
+
An optional `[submit]` section can replace the built-in merge and run setup
|
|
50
|
+
after the upstream merge has been resolved:
|
|
51
|
+
|
|
52
|
+
```toml
|
|
53
|
+
[submit]
|
|
54
|
+
pull_command = "git pull --no-edit origin main"
|
|
55
|
+
setup_command = "yarn install --immutable"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Commands run directly in the prepared checkout without an implicit shell.
|
|
59
|
+
They also accept the full command form for explicit arguments and environment:
|
|
60
|
+
|
|
61
|
+
```toml
|
|
62
|
+
[submit.pull_command]
|
|
63
|
+
bin = "git"
|
|
64
|
+
args = ["pull", "--no-edit", "origin", "main"]
|
|
65
|
+
|
|
66
|
+
[submit.setup_command]
|
|
67
|
+
bin = "yarn"
|
|
68
|
+
args = ["install", "--immutable"]
|
|
69
|
+
env = { CI = "true" }
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`pull_command` runs instead of the built-in merge, but afix still fetches the
|
|
73
|
+
advertised default target first and verifies that the command incorporated its
|
|
74
|
+
exact commit. `setup_command` runs only after a clean merge and before afix
|
|
75
|
+
loads validators and fixers. Relative binary paths are resolved within the
|
|
76
|
+
prepared checkout.
|
|
77
|
+
|
|
78
|
+
## Useful Commands
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
# Interactive setup to authenticate and select pipelines
|
|
82
|
+
afix autoclass ado-init
|
|
83
|
+
# pull the latest 500 uncached failed builds of the pipelines you selected
|
|
84
|
+
afix autoclass pull-logs --count=500
|
|
85
|
+
# run metrics to generate graphs and csv to ./afix-metrics
|
|
86
|
+
afix autoclass metrics
|
|
87
|
+
# render previously computed dwell history without scanning logs or reading Git
|
|
88
|
+
afix autoclass metrics --metrics-provider=static
|
|
89
|
+
# merge historical metrics artifacts into one physical cache, oldest first
|
|
90
|
+
afix cache merge-metrics \
|
|
91
|
+
--input=/path/to/older-metrics-artifact \
|
|
92
|
+
--input=/path/to/newer-metrics-artifact \
|
|
93
|
+
--output=.cache/afix \
|
|
94
|
+
--replace
|
|
95
|
+
# pull unique PR ids from metrics csv
|
|
96
|
+
cat afix-metrics/build-history.csv | python3 -c 'import csv,sys; seen=set(); [print(r["pr_id"]) for r in csv.DictReader(sys.stdin) if r["is_open"]=="true" and r["fixable"]=="true" and r["is_safe_submit"]=="true" and not (r["pr_id"] in seen or seen.add(r["pr_id"]))]' > afix-metrics/safe-pr-ids.log
|
|
97
|
+
# fix all, sequentially
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Metrics reports always use the current afix and smart-merge configuration.
|
|
101
|
+
Compute and `pull-logs` runs populate config-keyed build classification history
|
|
102
|
+
and commit-OID-keyed closure/token-usage facts in the shared SQLite cache.
|
|
103
|
+
Static reports read only those cached historical inputs; a build without
|
|
104
|
+
classification history for the current config is charted as `Unavailable`.
|
|
105
|
+
Historical artifacts should contain only normalized metrics state. Merge them
|
|
106
|
+
oldest to newest with `afix cache merge-metrics`, extend the resulting cache
|
|
107
|
+
with `pull-logs`, and render it with the static provider. Use `--cache-dir` to
|
|
108
|
+
read or write a cache outside the repository default.
|
package/cli
CHANGED
|
Binary file
|