Skip to content

Persist team assignment.#10

Merged
k82cn merged 4 commits into
mainfrom
presist_assignment
Mar 9, 2026
Merged

Persist team assignment.#10
k82cn merged 4 commits into
mainfrom
presist_assignment

Conversation

@k82cn

@k82cn k82cn commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the capability to persist team assignments across different session states and recovery scenarios. By integrating team_assignment directly into the session model and ensuring it's carried over during session creation and recovery processes for both Gitea and GitHub bridges, the system gains improved stability and consistency in how team responsibilities are managed and maintained throughout an issue's lifecycle.

Highlights

  • Session Model Update: The Session dataclass in firewood/models.py was updated to include a team_assignment field, allowing team assignments to be persisted with sessions. This involved adding serialization and deserialization logic for this new field.
  • Session Creation Enhancement: The create_session method in firewood/session.py was modified to accept an optional team_assignment parameter, ensuring that new sessions can be initialized with a specific team assignment.
  • Gitea Recovery Integration: The Gitea recovery strategies (GiteaRecoveryStrategy and ContextRecoveryStrategy) were updated to retrieve existing team_assignment from the IssueState and pass it to the session during recovery or creation, ensuring consistency for Gitea issues.
  • GitHub Recovery Integration: Similarly, the GitHub recovery strategies (GitHubRecoveryStrategy and ContextRecoveryStrategy) were updated to retrieve team_assignment from the IssueState and pass it to the session during recovery or creation, maintaining consistency for GitHub issues.
  • Logging Improvements: Logging statements across various recovery and session creation methods were enhanced to include information about whether a team_assignment was present, aiding in debugging and monitoring.
Changelog
  • firewood/bridges/gitea/recovery.py
    • Retrieved team_assignment from issue_state and passed it to the Session constructor in GiteaRecoveryStrategy.recover.
    • Updated logging in GiteaRecoveryStrategy.recover to include team_assignment status.
    • Retrieved team_assignment from state.issues if available and passed it to create_session in ContextRecoveryStrategy.recover.
    • Updated logging in ContextRecoveryStrategy.recover to include team_assignment status.
  • firewood/bridges/github/recovery.py
    • Retrieved team_assignment from issue_state and passed it to the Session constructor in GitHubRecoveryStrategy.recover.
    • Updated logging in GitHubRecoveryStrategy.recover to include team_assignment status.
    • Retrieved team_assignment from state.issues if available and passed it to create_session in ContextRecoveryStrategy.recover.
    • Updated logging in ContextRecoveryStrategy.recover to include team_assignment status.
  • firewood/models.py
    • Added __future__ import for annotations and TYPE_CHECKING import for IssueTeamAssignment.
    • Added team_assignment: IssueTeamAssignment | None = None field to the Session dataclass.
    • Modified to_dict method to serialize the team_assignment field.
    • Modified from_dict method to deserialize the team_assignment field, including a conditional import.
    • Modified create_new static method to accept and set the team_assignment parameter.
  • firewood/session.py
    • Added IssueTeamAssignment import for type checking.
    • Modified create_session method signature to accept an optional team_assignment parameter.
    • Passed the team_assignment parameter to the Session.create_new method.
    • Updated logging in create_session to include team_assignment status.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown

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 correctly implements the persistence of team_assignment across session creation and recovery for both Gitea and GitHub bridges. The changes to the Session model and SessionManager are also appropriate. I've added a few suggestions to improve code conciseness and maintainability in the recovery logic and model deserialization.

Comment thread firewood/bridges/gitea/recovery.py Outdated
Comment on lines +162 to +164
team_assignment = None
if issue["number"] in state.issues:
team_assignment = state.issues[issue["number"]].team_assignment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For improved conciseness and readability, you can use dict.get() to retrieve the issue_state and then access team_assignment from it. This avoids the multi-line if block and is more idiomatic.

        issue_state = state.issues.get(issue["number"])
        team_assignment = issue_state.team_assignment if issue_state else None

Comment thread firewood/bridges/github/recovery.py Outdated
Comment on lines +221 to +223
team_assignment = None
if issue.number in state.issues:
team_assignment = state.issues[issue.number].team_assignment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For improved conciseness and readability, you can use dict.get() to retrieve the issue_state and then access team_assignment from it. This avoids the multi-line if block.

        issue_state = state.issues.get(issue.number)
        team_assignment = issue_state.team_assignment if issue_state else None

Comment thread firewood/models.py
Comment on lines +229 to +234
team_assignment = None
team_data = data.get("team_assignment")
if team_data:
from firewood.team.models import IssueTeamAssignment

team_assignment = IssueTeamAssignment.from_dict(team_data)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This block can be made more concise. You can use the walrus operator := (Python 3.8+) to combine getting and checking team_data. Additionally, while local imports are acceptable for avoiding circular dependencies, it's stylistically better to have them at the top of the function rather than inside a conditional.

Suggested change
team_assignment = None
team_data = data.get("team_assignment")
if team_data:
from firewood.team.models import IssueTeamAssignment
team_assignment = IssueTeamAssignment.from_dict(team_data)
team_assignment = None
if team_data := data.get("team_assignment"):
from firewood.team.models import IssueTeamAssignment
team_assignment = IssueTeamAssignment.from_dict(team_data)

k82cn added 2 commits March 8, 2026 17:50
- Add emma (TPM), frank (dev), grace (dev), henry (arch), ivy (qa)
- Remove Background section from all member profiles
- Enhance Expertise with specific tools and methodologies
- Replace Communication Style with role-appropriate styles:
  - TPM: Management Style
  - Arch: Design Style
  - Dev: Coding Style
  - QA: Testing Style
@k82cn
k82cn force-pushed the presist_assignment branch from 69302ae to c8a6579 Compare March 8, 2026 09:51
@k82cn
k82cn merged commit b535d48 into main Mar 9, 2026
3 checks passed
@k82cn
k82cn deleted the presist_assignment branch March 9, 2026 12:52
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.

1 participant