Skip to content

Commit f1d300c

Browse files
committed
fix(learn): address CI failures in semantic-search.ipynb
- Fix broken links: use guides/projects/understanding-projects for docs, use docs/semantic-search.ipynb for fast notebook - Consolidate imports into first code cell (check-structure) - Pin pinecone-plugin-inference for check-pinning - Single-line pip install to avoid backslash parsed as package - Fix ruff import order (I001)
1 parent d332a16 commit f1d300c

6 files changed

Lines changed: 1225 additions & 547 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# tb-cleanup-orphaned
2+
3+
Find tickets marked "In Progress" that have no associated PR and move them back to Backlog.
4+
5+
**IMPORTANT**: This is a cleanup operation. Do not create PRs or do implementation work.
6+
7+
## Find In Progress Tickets
8+
9+
Use Linear MCP to query for tickets in project "Notebook Examples" with label "docs:examples"
10+
that have status "In Progress".
11+
12+
## Check Each Ticket for Associated PR
13+
14+
For each ticket found:
15+
16+
1. **Extract the ticket identifier** (e.g., "EXA-123")
17+
18+
2. **Search GitHub for associated PRs** using:
19+
```bash
20+
gh pr list --state all --search "<ticket_identifier>"
21+
```
22+
23+
Also check for PRs that might reference the ticket in the branch name:
24+
```bash
25+
gh pr list --state open --json number,title,headRefName | grep -i "<ticket_identifier>"
26+
```
27+
28+
3. **Determine if the ticket is orphaned**:
29+
- If NO open PR is found that references this ticket → ticket is ORPHANED
30+
- If an open PR exists → ticket is NOT orphaned (leave it alone)
31+
- If only closed/merged PRs exist → ticket may need status update to "Done"
32+
33+
## Handle Orphaned Tickets
34+
35+
For each orphaned ticket (In Progress with no open PR):
36+
37+
1. **Update the ticket status** in Linear to "Backlog"
38+
39+
2. **Add a comment** to the ticket explaining:
40+
```
41+
Automated cleanup: This ticket was marked "In Progress" but no associated GitHub PR was found.
42+
Moving back to Backlog so it can be picked up again.
43+
```
44+
45+
3. **Log the action**: "Moved [TICKET-ID] back to Backlog (no PR found)"
46+
47+
## Handle Tickets with Merged PRs
48+
49+
If a ticket is "In Progress" but has a merged PR (not open):
50+
51+
1. **Update the ticket status** in Linear to "Done"
52+
53+
2. **Add a comment**:
54+
```
55+
Automated cleanup: Found merged PR #[NUMBER]. Updating status to Done.
56+
```
57+
58+
3. **Log the action**: "Marked [TICKET-ID] as Done (PR #[NUMBER] was merged)"
59+
60+
## Summary
61+
62+
At the end, report:
63+
- Total tickets checked
64+
- Tickets moved to Backlog (orphaned)
65+
- Tickets marked Done (merged PR found)
66+
- Tickets left unchanged (open PR exists)
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# tb-iterate-review-tickets
2+
3+
Find one ticket in review that matches this worker's shard, then actively work on its PR.
4+
5+
**IMPORTANT**: Do not just list PRs or tickets. Pick ONE and actively work on it.
6+
7+
## Parse Shard Info
8+
9+
This command is invoked with shard information in the prompt:
10+
- Worker shard index (e.g., 0, 1, 2)
11+
- Total workers (e.g., 3)
12+
13+
## Find a Ticket
14+
15+
Use Linear MCP to query for tickets in project "Notebook Examples" with label "docs:examples"
16+
that have status "In Review".
17+
18+
Filter the results to only tickets where:
19+
`(numeric_portion_of_ticket_id % total_workers) == worker_index`
20+
21+
For example, if the ticket ID is "EXA-123" and this is worker 1 of 3:
22+
- Extract 123 from the ID
23+
- Check: 123 % 3 = 0, which does not equal 1
24+
- Skip this ticket
25+
26+
**Pick the first matching ticket.** If no matching tickets are found, say "No tickets for this shard" and exit.
27+
28+
## Find the Associated PR
29+
30+
From the selected ticket, find the associated GitHub PR. Check:
31+
- The ticket description for a PR link
32+
- Comments on the ticket
33+
- Or use `gh pr list` to find PRs mentioning the ticket ID
34+
35+
**If no PR is found, say "No PR found for ticket [ID]" and exit.**
36+
37+
## Checkout the PR Branch
38+
39+
Run these commands to checkout the PR branch:
40+
```bash
41+
git fetch origin
42+
gh pr checkout <PR_NUMBER>
43+
```
44+
45+
## Run PR Iteration
46+
47+
**Now actively work on this PR.** Check for CI failures, review comments, or inline comments using:
48+
```bash
49+
gh pr checks <PR_NUMBER>
50+
gh pr view <PR_NUMBER> --comments
51+
```
52+
53+
For each error or piece of feedback, first assess the scope:
54+
55+
**Small/easy fixes (address now):**
56+
- Typos, formatting issues, minor code improvements
57+
- Bug fixes directly related to the PR's purpose
58+
- Clarifications or documentation improvements within scope
59+
60+
For these:
61+
- Plan and implement a fix for the problem
62+
- Make a commit that describes the change
63+
- Push the commit
64+
- Reply saying the feedback was addressed and mark the conversation as resolved
65+
66+
**Large or out-of-scope changes (defer to follow-up):**
67+
- Significant refactoring beyond the PR's original purpose
68+
- New features or enhancements not in the original ticket
69+
- Changes that would require substantial additional testing or refactoring
70+
- Suggestions that are good ideas but not blocking for this PR
71+
72+
For these, create a follow-up ticket:
73+
74+
1. **Create a Linear issue** in the "Notebook Examples" project with:
75+
- **Title**: A clear, actionable summary of the feedback
76+
- **Labels**: `docs:examples` and `Improvement`
77+
- **Description** that includes:
78+
- The original feedback/suggestion
79+
- Link to the PR where this was raised
80+
- Link to the original ticket this is a follow-up to
81+
- Any relevant context about why this was deferred
82+
- The standard implementation instructions:
83+
84+
```
85+
This ticket needs to be implemented in the https://github.com/pinecone-io/examples repository.
86+
87+
Pull master to ensure you have the latest changes before beginning any implementation work.
88+
89+
When the fix is complete, the agent should:
90+
91+
1. **Quality Review**
92+
- Verify the notebook executes successfully from top to bottom
93+
- Ensure code follows Python best practices and is well-commented
94+
- Check that all markdown cells render correctly
95+
- Score this notebook according to the criteria in .github/NOTEBOOK_REVIEW_TEMPLATE.md and implement fixes for any issues uncovered.
96+
97+
2. **Create Pull Request**
98+
- Create a PR with a title that follows Conventional Commits format
99+
- Include a clear description of what was improved and why
100+
- Reference the related GitHub issue and Linear issue number
101+
- Summarize the value of the improvement
102+
```
103+
104+
2. **Reply on GitHub** with: "This is a good suggestion but outside the scope of this PR. Created follow-up ticket [TICKET-ID] to address this separately."
105+
106+
3. **Mark the conversation as resolved**
107+
108+
**Invalid feedback:**
109+
- If the problem does not exist, reply on GitHub with relevant context explaining why. Then resolve the conversation.
110+
111+
Next, check the PR to see if there are any inline comments that are not part of a formal review. Follow the same procedure for confirming, fixing, and pushing changes. Mark the conversation as resolved when the fix has been pushed.
112+
113+
## Done
114+
115+
After completing work on this PR:
116+
- All addressable feedback should be fixed and pushed
117+
- All conversations should be resolved (either fixed or deferred with follow-up ticket)
118+
- Any follow-up tickets should be created in Linear
119+
120+
Exit after processing this one PR. The next iteration will pick up the next ticket.
121+
122+
**Remember**: The goal is to make progress on the PR, not just report its status.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# tb-merge-ready-prs
2+
3+
Find one PR that is ready to merge and merge it.
4+
5+
## Find Merge-Ready PRs
6+
7+
Use `gh pr list` to find open PRs in this repository. For each PR, check if it meets
8+
all merge conditions:
9+
10+
1. All CI checks are passing
11+
2. Has an appropriate GitHub label
12+
3. Has no unresolved review feedback (comments with follow-up tickets linked count as resolved)
13+
4. Has a completed Bugbot review with all comments addressed or deferred to follow-up tickets
14+
15+
## Select a Candidate
16+
17+
If no PRs meet all conditions, log "No PRs ready to merge" and exit.
18+
19+
If multiple PRs are ready, pick one (preferably the oldest).
20+
21+
## Checkout the PR Branch
22+
23+
Fetch and checkout the branch associated with the selected PR.
24+
25+
## Verify and Merge
26+
27+
Verify all conditions one more time:
28+
- The PR has an appropriate GitHub label
29+
- The PR has a completed Bugbot review with all comments addressed or deferred to follow-up tickets
30+
- All CI checks are passing
31+
- There is no unresolved review feedback (comments with follow-up tickets linked count as resolved)
32+
33+
If any condition is not met, log the issue and exit without merging.
34+
35+
If all conditions are met, merge the PR.
36+
37+
## Update Linear
38+
39+
After successful merge, find the associated Linear ticket and update its status to "Done".
40+
41+
## Done
42+
43+
Exit after processing this one PR. The next iteration will pick up the next one.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# tb-pick-next-ticket
2+
3+
Pick up one ticket from the backlog and implement it.
4+
5+
## Check Capacity
6+
7+
Query Linear for tickets in project "Notebook Examples" with label "docs:examples"
8+
that have status "In Progress".
9+
10+
If the count is 6 or more, log "At capacity - skipping" and exit immediately.
11+
12+
## Checkout Master
13+
14+
Checkout the master branch and pull to get the latest changes.
15+
16+
## Choose a Ticket
17+
18+
Find the next Linear ticket in project "Notebook Examples" with label "docs:examples"
19+
that has status "Backlog", prioritized by priority then creation date.
20+
21+
Mark the ticket as started in Linear (set status to "In Progress").
22+
23+
## Review and Plan
24+
25+
Review the ticket description:
26+
- If it contains a detailed implementation plan, validate the plan and proceed
27+
with implementation if sensible.
28+
- If no plan exists, draft a reasonable implementation plan based on the ticket
29+
description and proceed with implementation.
30+
31+
## Implement
32+
33+
- Create a new feature branch
34+
- Iterate by assessing the code against the criteria in .github/NOTEBOOK_REVIEW_TEMPLATE.md
35+
- Ensure the notebook has valid syntax
36+
- Format the notebook changed using uv to run ruff format on the notebook
37+
38+
## Open a PR
39+
40+
**Title:**
41+
- Use a title that follows Conventional Commits format
42+
43+
**Description:**
44+
- Include a clear summary of what the example or documentation accomplishes
45+
- Describe the intended audience and use case
46+
- List any prerequisites or dependencies
47+
- Highlight key concepts demonstrated
48+
- Link to any related GitHub issues, PRs, or Linear issues
49+
- Link to related Pinecone documentation where relevant
50+
- Avoid long lists of files changed
51+
52+
**Metadata:**
53+
- Apply a GitHub label to the PR (helpful for categorizing changes)
54+
55+
Update the Linear ticket:
56+
- Add a link to the GitHub PR
57+
- Set status to "In Review"
58+
59+
## Done
60+
61+
Exit after opening the PR. Review iteration is handled by a separate worker.

0 commit comments

Comments
 (0)