8000 chore(agent-loop): deploy the engineering agent loop's workflows that call no model by engineering-agent-loop-deploy[bot] · Pull Request #71 · dlt-hub/dlthub-init · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 42 additions & 3 deletions .github/workflows/bump-changelog-entry.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ function directSpecs(text) {
return directNames(text, new Map());
}

/**
* The skills a `skills/` directory holds, or null where the caller named no such directory.
*
* A skill is one directory: `.gitkeep` and anything else loose beside them is not one. Null
* rather than an empty list, because a baseline that is not there read as "no skills" reports
* every skill in the repository as one this bump added.
*/
function skillNames(dir) {
if (!dir || !fs.existsSync(dir)) return null;
return fs.readdirSync(dir, { withFileTypes: true })
.filter((e) => e.isDirectory())
.map((e) => e.name)
.sort((a, b) => a.localeCompare(b));
}

const versions = (list) => list.map((p) => `\`${p.name}\` ${p.from} → ${p.to}`);

// How each of the four bullets opens. A second bump finds the first one's lines by these, so
Expand Down Expand Up @@ -119,6 +134,8 @@ function sentenceList(parts) {

const plural = (n, noun) => `${n} ${noun}${n === 1 ? '' : 's'}`;

const skillList = (names) => sentenceList(names.map((n) => `\`${n}\``));

// Direct dependencies are named and transitives are counted, which is the shape of every
// released entry. It applies to a package arriving and leaving as much as to one moving
// version: a transitive that left is the resolver's business, and naming thirteen of them
Expand Down Expand Up @@ -170,8 +187,18 @@ function renderEntry({ scaffold, root, direct, rootDirect = null, deps = null, s
if (root && root.moved.length + root.added.length + root.removed.length) {
bullets.push(lockBullet({ lead: LEADS.root, diff: root, direct: rootDirect || direct }));
}
// The generator rewrites `skills/` whole at each ref, so a moved ref can add or drop a whole
// skill that everybody running `uvx dlthub-init` then gets. A seven-character SHA says none
// of that. What changed inside a skill that was already there is a person's to describe, as
// it is in the released entries.
if (skills && skills.from !== skills.to) {
bullets.push(`- ${LEADS.skills} \`${skills.to}\`.`);
const said = [];
if (skills.added && skills.added.length) said.push(`adding ${skillList(skills.added)}`);
if (skills.removed && skills.removed.length) {
said.push(`dropping ${skillList(skills.removed)}`);
}
const tail = said.length ? `, ${said.join(', ')}` : '';
bullets.push(`- ${LEADS.skills} \`${skills.to}\`${tail}.`);
}
return bullets;
}
Expand Down Expand Up @@ -238,14 +265,26 @@ function main(argv, io = console) {
}
const skillsFrom = value('--skills-before');
const skillsTo = value('--skills-after');
const skillDirs = [value('--skills-dir-before'), value('--skills-dir-after')];
const [wasSkills, nowSkills] = skillDirs.map(skillNames);
if (skillDirs.some(Boolean) && !(wasSkills && nowSkills)) {
io.error('bump-changelog-entry: a `skills/` directory the caller named is not there, so the'
+ ' workbench bullet names the ref alone');
}
const skillDiff = wasSkills && nowSkills
? {
added: nowSkills.filter((n) => !wasSkills.includes(n)),
removed: wasSkills.filter((n) => !nowSkills.includes(n)),
}
: { added: [], removed: [] };

const entry = {
scaffold: lockDiff(value('--scaffold-before'), value('--scaffold-after')),
root: lockDiff(value('--root-before'), value('--root-after')),
direct,
rootDirect: value('--root-direct') ? directNames(read(value('--root-direct'))) : null,
deps,
skills: skillsFrom && skillsTo ? { from: skillsFrom, to: skillsTo } : null,
skills: skillsFrom && skillsTo ? { from: skillsFrom, to: skillsTo, ...skillDiff } : null,
};
const bullets = renderEntry(entry);

Expand Down Expand Up @@ -276,5 +315,5 @@ if (require.main === module) process.exit(main(process.argv.slice(2)));

module.exports = {
LEADS, isOwnBullet, askedAbout, parseLock, normalise, diffLocks, directNames, directSpecs,
lockBullet, renderEntry, insertEntry, main,
skillNames, lockBullet, renderEntry, insertEntry, main,
};
61 changes: 24 additions & 37 deletions .github/workflows/bump-dlthub-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
run: |
set -euo pipefail

# an open bump stops the next one, including a failed recipe's issue, which is
# the loop saying it will not act again until a person looks
# an open bump stops the next one: the pull request a run that succeeded left, or
# the issue a failed recipe left, which is the loop saying it will not act again
open_prs=$(gh pr list --state open --label agent:authored --limit 100 \
--json headRefName \
--jq '[.[] | select(.headRefName | startswith("chore/bump-scaffold-"))] | length')
Expand Down Expand Up @@ -122,21 +122,25 @@ jobs:
# before it wrote. Written against the tip, a second bump between two releases appends
# a second `Refreshed ...` line describing the same packages a version later.
#
# A branch with no release tag behind it, and a tag predating one of these four files,
# both fall back to the tip. All four or none: two baselines in one entry read as
# A branch with no release tag behind it, and a tag predating any of these five paths,
# both fall back to the tip. All five or none: two baselines in one entry read as
# packages arriving and going.
- name: Keep the state the entry is written against
id: base
if: steps.decide.outputs.bump == 'true'
run: |
set -euo pipefail
rm -rf /tmp/bump-base /tmp/bump-tag
mkdir -p /tmp/bump-base /tmp/bump-tag

# `git stash` would do the same for the tip and would also hide a failure
# `git stash` would do the same for the tip and would also hide a failure. `skills/`
# is copied as a directory because the bullet names the skills that arrived and
# went, and their names are the directory names under it
cp uv.lock /tmp/bump-base/root.uv.lock
cp "${SCAFFOLD}/uv.lock" /tmp/bump-base/scaffold.uv.lock
cp "${SCAFFOLD}/pyproject.toml" /tmp/bump-base/scaffold.pyproject.toml
cp scripts/generate_skills.py /tmp/bump-base/generate_skills.py
cp -r skills /tmp/bump-base/skills
against="this branch's tip"

tag=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || true)
Expand All @@ -145,12 +149,17 @@ jobs:
elif git show "${tag}:uv.lock" > /tmp/bump-tag/root.uv.lock \
&& git show "${tag}:${SCAFFOLD}/uv.lock" > /tmp/bump-tag/scaffold.uv.lock \
&& git show "${tag}:${SCAFFOLD}/pyproject.toml" > /tmp/bump-tag/scaffold.pyproject.toml \
&& git show "${tag}:scripts/generate_skills.py" > /tmp/bump-tag/generate_skills.py
&& git show "${tag}:scripts/generate_skills.py" > /tmp/bump-tag/generate_skills.py \
&& git archive "$tag" skills | tar -xf - -C /tmp/bump-tag
then
cp -r /tmp/bump-tag/. /tmp/bump-base/
# the tip's copy is replaced rather than merged into: a skill directory the tip
# holds and the tag does not would survive a merge, and the bullet would not name
# it as one this span added
rm -rf /tmp/bump-base
mv /tmp/bump-tag /tmp/bump-base
against="$tag"
else
echo "::warning::${tag} does not carry every file the entry is written from."
echo "::warning::${tag} does not carry every path the entry is written from."
fi

echo "::notice::the changelog entry is written against ${against}."
Expand Down Expand Up @@ -225,6 +234,8 @@ jobs:
--deps-after "${SCAFFOLD}/pyproject.toml" \
--skills-before "$(sed -n 's/^WORKBENCH_REF_SHORT = "\(.*\)"$/\1/p' /tmp/bump-base/generate_skills.py)" \
--skills-after "$(sed -n 's/^WORKBENCH_REF_SHORT = "\(.*\)"$/\1/p' scripts/generate_skills.py)" \
--skills-dir-before /tmp/bump-base/skills \
--skills-dir-after skills \
--changelog CHANGELOG.md > /tmp/bump-entry.md
code=$?
set -e
Expand Down Expand Up @@ -277,7 +288,7 @@ jobs:

# written line by line: a heredoc terminator has to be unindented, and an unindented
# line inside a `run: |` block ends the block
- name: Open the issue, the pull request, and start review
- name: Open the pull request
if: steps.entry.outputs.wrote == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Expand All @@ -289,39 +300,13 @@ jobs:
set -euo pipefail
run_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"

{
echo "\`uvx dlthub-init\` scaffolds a workspace from the dependency locks in this repository, so until those are refreshed a new workspace gets whatever versions were current when they were last written. ${WHY}"
echo
echo "[Run ${GITHUB_RUN_ID}](${run_url}) refreshed them and opened a pull request. Publishing a release stays a person's job and is not part of this."
echo
echo '## Acceptance criteria'
echo
echo '- [ ] Both `uv.lock` files resolve the newest versions their `pyproject.toml` allows: `make lock-check` and `make scaffold-lock-check` pass.'
echo '- [ ] The scaffolded workspace'"'"'s dependencies match dlt'"'"'s `workspace_deps()`: `make scaffold-deps-check` passes.'
echo '- [ ] `skills/` matches what `scripts/generate_skills.py` produces: `make check-skills` passes.'
echo '- [ ] `CHANGELOG.md` names every dependency whose version moved since the last release, once each, with its old and new version.'
echo '- [ ] `make ci` passes.'
echo
echo '## Scope'
echo
echo "Both \`uv.lock\` files, \`${SCAFFOLD}/pyproject.toml\`, the pinned ref in \`scripts/generate_skills.py\`, \`skills/\` and \`CHANGELOG.md\`. The version in the root \`pyproject.toml\` moves at a release and is left alone here."
} > /tmp/bump-issue.md

# review reads a pull request's tier off the issue it closes, and no triage pass
# runs here to write one
issue=$(gh issue create \
--title 'chore: refresh the bundled workspace lock' \
--label risk:low --label agent:authored \
--body-file /tmp/bump-issue.md | sed 's#.*/##')
echo "::notice::opened issue #${issue}"

git push -q origin "$BRANCH"

{
echo "Closes #${issue}"
echo
echo "\`uvx dlthub-init\` scaffolds a workspace from the dependency locks in this repository. This refreshes them, so a new workspace resolves the newest \`dlt\`, \`dlthub\` and \`dlthub-client\` that \`${SCAFFOLD}/pyproject.toml\` allows. ${WHY}"
echo
echo "The version in the root \`pyproject.toml\` moves at a release and is left alone here. Publishing one stays a person's job."
echo
echo '## What changed'
echo
cat /tmp/bump-entry.md
Expand All @@ -332,6 +317,8 @@ jobs:
echo
echo "\`make ci\` passed on [run ${GITHUB_RUN_ID}](${run_url}) before this branch was pushed, and runs again here. It covers both lock guards, the dependency sync, the skills check, the unit and integration suites and the wheel build."
echo
echo "The entry above is the part a person checks: \`CHANGELOG.md\` has to name every dependency whose version moved since the last release, once each, with its old and new version, and every skill \`skills/\` gained or lost in that span."
echo
echo "Neither \`uv.lock\` is worth reading as a diff. The bullets above are the account of them, and \`${SCAFFOLD}/pyproject.toml\` is what decides which versions they may resolve to."
echo
echo 'No further refresh is prepared while this is open. Merge it or close it.'
Expand Down
Loading
0