-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworkflow.yaml
More file actions
122 lines (116 loc) · 3.15 KB
/
workflow.yaml
File metadata and controls
122 lines (116 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# yaml-language-server: $schema=https://raw.githubusercontent.com/codemod/codemod/refs/heads/main/schemas/workflow.json
version: "1"
state:
schema:
shards:
type: array
items:
type: object
properties:
name:
type: string
team:
type: string
directory:
type: string
_meta_shard:
type: number
_meta_files:
type: array
items:
type: string
params:
schema:
shardingMethod:
name: "Sharding Method"
description: "The method to use for sharding"
type: string
default: "codeowner"
oneOf:
- type: string
enum:
- "codeowner"
- "directory"
shardingDirectoryTarget:
name: "Sharding Directory Target"
description: "When sharding by directory, the directory to target for the codemod"
type: string
default: "./src"
pr_size:
name: "PR Size"
description: "The maximum number of files to include in each PR"
type: number
default: 20
nodes:
- id: evaluate-shards
name: Evaluate Shards
trigger:
type: automatic
steps:
- name: "Evaluate shards by directory"
if: params.shardingMethod == "directory"
shard:
method:
type: directory
max_files_per_shard: ${{ params.pr_size }}
target: ${{ params.shardingDirectoryTarget }}
output_state: shards
js-ast-grep:
js_file: scripts/codemod.ts
language: "tsx"
semantic_analysis: workspace
include:
- "**/*.ts"
- "**/*.tsx"
- "**/*.jsx"
- "**/*.js"
- "**/*.mjs"
- name: "Evaluate shards by codeowner"
if: params.shardingMethod == "codeowner"
shard:
method:
type: codeowner
max_files_per_shard: ${{ params.pr_size }}
target: "."
output_state: shards
js-ast-grep:
js_file: scripts/codemod.ts
language: "tsx"
semantic_analysis: workspace
include:
- "**/*.ts"
- "**/*.tsx"
- "**/*.jsx"
- "**/*.js"
- "**/*.mjs"
- id: apply-transforms
name: Apply AST Transformations
trigger:
type: manual
depends_on:
- evaluate-shards
strategy:
type: matrix
from_state: shards
pull_request:
title: "[DRAFT] refactor: Run debarrel shard ${{ matrix.name }}"
body: "This pull request runs debarrel for shard ${{ matrix.name }}."
draft: true
steps:
- id: debarrel-js-ast-grep
name: "Debarrel: rewrite imports and clean up barrels"
js-ast-grep:
js_file: scripts/codemod.ts
language: "tsx"
semantic_analysis: workspace
- id: install-skill
name: Install Skill
trigger:
type: manual
depends_on:
- apply-transforms
steps:
- name: "Install debarrel skill"
install-skill:
package: "debarrel"
path: "./agents/skill/SKILL.md"