Skip to content

chore: add some skills and update agents doc#3696

Merged
aignas merged 2 commits intobazel-contrib:mainfrom
rickeylev:chore.agent.doc.and.skills
Apr 12, 2026
Merged

chore: add some skills and update agents doc#3696
aignas merged 2 commits intobazel-contrib:mainfrom
rickeylev:chore.agent.doc.and.skills

Conversation

@rickeylev
Copy link
Copy Markdown
Collaborator

Some misc instructions for agents to follow.

  • Tell them about the multiple modules. I've found they can get
    confused trying to run code in different sub-modules.
  • Tell them to never run expunge. This hard-wipes caches and trashes
    build performance, not to mention takes many minutes itself
  • Tell them to use the fast-tests config, which captures more than
    just integration tests now.

Add skills for interacting with build kite, which makes automating
PRs a bit easier.

@rickeylev rickeylev requested a review from aignas as a code owner April 12, 2026 03:39
@rickeylev rickeylev enabled auto-merge April 12, 2026 03:40
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new agent skills for retrieving Buildkite results and retrying failed jobs, along with updates to the AGENTS.md documentation regarding Bazel configurations and repository structure. The review feedback suggests several improvements to the Python scripts, such as adding timeouts to network requests for robustness, handling URL fragments more safely, and ensuring that job filtering logic correctly implements the documented regex support.

Comment on lines +48 to +51
if not build_url.endswith(".json"):
json_url = build_url + ".json"
else:
json_url = build_url
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The URL construction for the JSON endpoint should handle potential trailing slashes in the build URL to ensure a valid path.

    json_url = build_url if build_url.endswith(".json") else build_url.rstrip("/") + ".json"

json_url = build_url

try:
with urllib.request.urlopen(json_url) as response:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Network requests should include a timeout to prevent the script from hanging indefinitely if the server is unresponsive.

Suggested change
with urllib.request.urlopen(json_url) as response:
with urllib.request.urlopen(json_url, timeout=10) as response:

# We need to transform it.

if "#" in job_url:
base, job_id = job_url.split("#")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using split("#") can cause a ValueError if the URL contains multiple hash characters. rsplit("#", 1) is safer for extracting the fragment identifier.

Suggested change
base, job_id = job_url.split("#")
base, job_id = job_url.rsplit("#", 1)

return False

try:
with urllib.request.urlopen(raw_url) as response:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Network requests should include a timeout to prevent the script from hanging indefinitely.

Suggested change
with urllib.request.urlopen(raw_url) as response:
with urllib.request.urlopen(raw_url, timeout=10) as response:

#!/usr/bin/env python3
import argparse
import json
import os
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The re module is required to support regex matching for job names as described in the help text.

Suggested change
import os
import os
import re


req = urllib.request.Request(url, data=data, headers=headers, method=method)
try:
with urllib.request.urlopen(req) as response:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Network requests should include a timeout to prevent the script from hanging indefinitely.

Suggested change
with urllib.request.urlopen(req) as response:
with urllib.request.urlopen(req, timeout=10) as response:

Comment on lines +73 to +78
if (
args.job_name
and args.job_name.lower() not in job_name.lower()
and args.job_name.lower() not in job.get("step_key", "").lower()
):
continue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The implementation should use regex matching to align with the help text for the --job-name argument, which claims to support regex.

        if args.job_name and not re.search(args.job_name, job_name, re.IGNORECASE) and \
           not re.search(args.job_name, job.get("step_key", ""), re.IGNORECASE):
            continue

@rickeylev rickeylev added this pull request to the merge queue Apr 12, 2026
@aignas aignas removed this pull request from the merge queue due to a manual request Apr 12, 2026
@aignas aignas merged commit 6d57b1a into bazel-contrib:main Apr 12, 2026
3 of 4 checks passed
@rickeylev rickeylev deleted the chore.agent.doc.and.skills branch April 12, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants