@afix-ci/cli-linux-x64 0.1.0-rc.4 → 0.1.0-rc.41
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 +99 -0
- package/cli +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
1
|
# afix
|
|
2
2
|
|
|
3
3
|
A simple tool for running scripts and correcting their outputs
|
|
4
|
+
|
|
5
|
+
## Prepare a pull request
|
|
6
|
+
|
|
7
|
+
`afix prepare-pr` updates the current branch with the selected remote's
|
|
8
|
+
advertised default branch, resolves configured smart-merge conflicts, runs
|
|
9
|
+
repository setup and the normal afix fix loop, then submits the result. The
|
|
10
|
+
working tree must be clean and HEAD must be attached to a local branch.
|
|
11
|
+
`--forge` and `--submit-method` are required:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
afix prepare-pr \
|
|
15
|
+
--forge github \
|
|
16
|
+
--submit-method dependent-pr \
|
|
17
|
+
--git-remote origin
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
By default, preparation mutates the current checkout. Use `--worktree` to
|
|
21
|
+
prepare on a new afix-prefixed branch in a unique sibling worktree, leaving the
|
|
22
|
+
current checkout unchanged:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
afix prepare-pr --worktree \
|
|
26
|
+
--forge github \
|
|
27
|
+
--submit-method dependent-pr
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Add `--swap-branch` when the submitted branch must retain the current branch
|
|
31
|
+
name. This option requires `--worktree`: the host checkout moves to
|
|
32
|
+
`<current-branch>-pre-pr-backup`, while the submission worktree checks out the
|
|
33
|
+
original branch without changing its upstream tracking configuration.
|
|
34
|
+
|
|
35
|
+
Failures before submission do not push or open a pull request. In worktree
|
|
36
|
+
modes, the prepared checkout is retained; failures print its path for
|
|
37
|
+
inspection. Swap setup is transactional, but after setup succeeds its backup
|
|
38
|
+
branch is intentionally retained.
|
|
39
|
+
|
|
40
|
+
### Repository preparation commands
|
|
41
|
+
|
|
42
|
+
An optional `[submit]` section can replace the built-in merge and run setup
|
|
43
|
+
after the upstream merge has been resolved:
|
|
44
|
+
|
|
45
|
+
```toml
|
|
46
|
+
[submit]
|
|
47
|
+
pull_command = "git pull --no-edit origin main"
|
|
48
|
+
setup_command = "yarn install --immutable"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Commands run directly in the prepared checkout without an implicit shell.
|
|
52
|
+
They also accept the full command form for explicit arguments and environment:
|
|
53
|
+
|
|
54
|
+
```toml
|
|
55
|
+
[submit.pull_command]
|
|
56
|
+
bin = "git"
|
|
57
|
+
args = ["pull", "--no-edit", "origin", "main"]
|
|
58
|
+
|
|
59
|
+
[submit.setup_command]
|
|
60
|
+
bin = "yarn"
|
|
61
|
+
args = ["install", "--immutable"]
|
|
62
|
+
env = { CI = "true" }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`pull_command` runs instead of the built-in merge, but afix still fetches the
|
|
66
|
+
advertised default target first and verifies that the command incorporated its
|
|
67
|
+
exact commit. `setup_command` runs only after a clean merge and before afix
|
|
68
|
+
loads validators and fixers. Relative binary paths are resolved within the
|
|
69
|
+
prepared checkout.
|
|
70
|
+
|
|
71
|
+
## Useful Commands
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
# Interactive setup to authenticate and select pipelines
|
|
75
|
+
afix autoclass ado-init
|
|
76
|
+
# pull the latest 500 failed builds of the pipelines you selected
|
|
77
|
+
afix autoclass pull-logs --count=500
|
|
78
|
+
# run metrics to generate graphs and csv to ./afix-metrics
|
|
79
|
+
afix autoclass metrics
|
|
80
|
+
# render previously computed dwell history without scanning logs or reading Git
|
|
81
|
+
afix autoclass metrics --metrics-provider=static
|
|
82
|
+
# prefer read-only CI artifacts in order and calculate remaining events locally
|
|
83
|
+
afix autoclass metrics --metrics-provider=combined-calculated-static \
|
|
84
|
+
--static-cache-dir=/path/to/preferred-metrics-artifact \
|
|
85
|
+
--static-cache-dir=/path/to/older-metrics-artifact \
|
|
86
|
+
--computed-cache-dir=.cache/afix
|
|
87
|
+
# pull unique PR ids from metrics csv
|
|
88
|
+
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
|
|
89
|
+
# fix all, sequentially
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Metrics reports always use the current afix and smart-merge configuration.
|
|
93
|
+
Compute and `pull-logs` runs populate config-keyed build classification history
|
|
94
|
+
and commit-OID-keyed closure/token-usage facts in the shared SQLite cache.
|
|
95
|
+
Static reports read only those cached historical inputs; a build without
|
|
96
|
+
classification history for the current config is charted as `Unavailable`.
|
|
97
|
+
Combined reports query repeatable static directories in command-line order.
|
|
98
|
+
Each complete, closed event is retained and excluded from later providers;
|
|
99
|
+
unknown, unavailable, or open events continue through the remaining static
|
|
100
|
+
directories and finally the calculated provider. Static directories are never
|
|
101
|
+
used for calculated writes; `--computed-cache-dir` defaults to the repository
|
|
102
|
+
afix cache.
|
package/cli
CHANGED
|
Binary file
|