Skip to content

Implement missing attach_file function - #130

Open
maritiren wants to merge 3 commits into
github:mainfrom
maritiren:fix-attach-file-bug
Open

maritiren wants to merge 3 commits into
github:mainfrom
maritiren:fix-attach-file-bug

Conversation

@maritiren

@maritiren maritiren commented Sep 13, 2026

Copy link
Copy Markdown

Using the option --state-issue is crashing the process. Here is the traceback from the crash:

  Traceback (most recent call last):
    File "/home/runner/work/_actions/maritiren/ghas-jira-integration/fix-attach-file-bug/cli.py", line 326, in <module>
      main()
    File "/home/runner/work/_actions/maritiren/ghas-jira-integration/fix-attach-file-bug/cli.py", line 323, in main
      args.func(args)
    File "/home/runner/work/_actions/maritiren/ghas-jira-integration/fix-attach-file-bug/cli.py", line 109, in sync
      jira_project.save_repo_state(repo_id, state, args.state_issue)
    File "/home/runner/work/_actions/maritiren/ghas-jira-integration/fix-attach-file-bug/jiralib.py", line 236, in save_repo_state
      self.jira.attach_file(
      ^^^^^^^^^^^^^^^^^^^^^
  AttributeError: 'Jira' object has no attribute 'attach_file'

I based my fix on the function @jmservera added to PR #119.

I triggered the bug by enabling the --state-issue option as in this commit, and ensured the fix worked by testing the fix with the option still enabled.

It posted this ticket to my test-Jira:
state_issue_working

Copilot AI balanced review requested due to automatic review settings September 13, 2026 16:31

Copilot AI 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.

🟢 Approval recommended

The implementation correctly resolves the reported missing-method failure and matches the existing caller’s data format.

Pull request overview

Adds the missing Jira attachment wrapper required to persist repository state in a Jira issue.

Changes:

  • Encodes state content as UTF-8 bytes.
  • Uploads it through Jira’s attachment API using an in-memory stream.
File summaries
File Description
jiralib.py Implements Jira.attach_file for state-file uploads.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants