Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ticket board and settings page for managing credentials #2

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented May 12, 2023

AutoPR Failure

Fixes #1

Description

This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.

Status

This pull request was being autonomously generated by AutoPR, but it encountered an error.

Error:

Traceback (most recent call last):
  File "/app/autopr/agents/brain_agent/base.py", line 75, in generate_pr
    self._generate_pr(event)
  File "/app/autopr/agents/brain_agent/simple_v1.py", line 34, in _generate_pr
    self.codegen_agent.generate_changes(
  File "/app/autopr/agents/codegen_agent/base.py", line 54, in generate_changes
    self._generate_changes(repo, issue, pr_desc, current_commit)
  File "/app/autopr/agents/codegen_agent/autonomous_v1/agent.py", line 320, in _generate_changes
    action = self.rail_service.run_prompt_rail(action_rail)
  File "/app/autopr/services/rail_service.py", line 196, in run_prompt_rail
    return self.run_rail_object(rail.output_type, prompt)
  File "/app/autopr/services/rail_service.py", line 118, in run_rail_object
    raw_o, dict_o = pr_guard(
  File "/venv/lib/python3.9/site-packages/guardrails/guard.py", line 144, in __call__
    guard_history = runner(prompt_params=prompt_params)
  File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 89, in __call__
    validated_output, reasks = self.step(
  File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 145, in step
    validated_output = self.validate(index, output_as_dict, output_schema)
  File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 262, in validate
    validated_output = output_schema.validate(output_as_dict)
  File "/venv/lib/python3.9/site-packages/guardrails/schema.py", line 328, in validate
    validated_response = self[field].validate(
  File "/venv/lib/python3.9/site-packages/guardrails/datatypes.py", line 344, in validate
    selected_value = schema[selected_key]
KeyError: 'null'

Please open an issue to report this.

Progress Updates

⚠️⚠️⚠️ Warning: Using gpt-3.5-turbo completion model. AutoPR is currently not optimized for this model. See irgolic/AutoPR#65 for more details. In the mean time, if you have access to the gpt-4 API, please use that instead. Please note that ChatGPT Plus does not give you access to the gpt-4 API; you need to sign up on the GPT-4 API waitlist.

✅ Planned pull request

Running rail InitialFileSelect in two steps...

Ran raw query
Prompt
Hey, somebody just opened an issue in my repo, could you help me write a pull request?

The issue is:
```#1 Ticket overview page

trondtactile: Create a webpage that renders tickets in a Kanban board.
Tickets should support showing comments.

The tickets should come from Monday.com and JIRA.

There should be a settings page to manage credentials for Monday.com and JIRA, to be able to read out ticket data.

A ticket should also have a link to open the original ticket in a new tab.

```

The list of files in the repo is:
```README.md (186 tokens)
.github/workflows/autopr.yml (532 tokens)```

Should we take a look at any files? If so, pick only a few files (max 5000 tokens). 
Respond with a very short rationale, and a list of files.
If looking at files would be a waste of time with regard to the issue, respond with an empty list.
Response
Looking at the `.github/workflows/autopr.yml` file would be a waste of time with regard to the issue. Instead, we should create a new file to implement the feature. No file list needed at this point.
InitialFileSelectResponse: Failed to parse output dict
Prompt
Given the following document surrounded by `+++++`, answer the following questions. 
If the answer doesn't exist in the document, enter `null`.

+++++
Looking at the `.github/workflows/autopr.yml` file would be a waste of time with regard to the issue. Instead, we should create a new file to implement the feature. No file list needed at this point.
+++++

Extract information from this document and return a JSON that follows the correct schema.
If looking at files would be a waste of time, please submit an empty list.


Given below is XML that describes the information to extract from this document and the tags to extract it into.


```xml
<output>
    <list name="filepaths">
        <string description="Files in this repository that we should look at."/>
    </list>
</output>
```
Raw Response
{"filepaths": []}
Dict Response
{}
Error
Traceback (most recent call last):
  File "/app/autopr/services/rail_service.py", line 143, in run_rail_object
    parsed_obj = rail_object.parse_obj(dict_o)
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for InitialFileSelectResponse
filepaths
  field required (type=value_error.missing)

Running rail ProposePullRequest in two steps...

Ran raw query
Prompt
Hey somebody just submitted an issue, could you own it, write some commits, and a pull request?

These are notes we took while looking at the repo:
```The repository's contents were irrelevant, only create new files to address the issue.```

This is the issue that was opened:
```#1 Ticket overview page

trondtactile: Create a webpage that renders tickets in a Kanban board.
Tickets should support showing comments.

The tickets should come from Monday.com and JIRA.

There should be a settings page to manage credentials for Monday.com and JIRA, to be able to read out ticket data.

A ticket should also have a link to open the original ticket in a new tab.

```

When you're done, send me the pull request title, body, and a list of commits, each coupled with which files we should be looking at to write the commit's code.
Ensure you specify the files relevant to the commit, especially if the commit is a refactor.
Folders are created automatically; do not make them in their own commit.
Response
Sure thing! I can definitely help with that. Here's a plan to tackle this issue:

1. Create a new file called `ticket.html` to render the tickets in a Kanban board.
2. Create a new file called `settings.html` to manage credentials for Monday.com and JIRA.
3. Create a new file called `ticket.css` to style the ticket board and settings page.
4. Create a new file called `ticket.js` to handle fetching ticket data from Monday.com and JIRA, and rendering it on the ticket board.
5. Create a new file called `settings.js` to handle saving and loading credentials for Monday.com and JIRA.

Here are the commits that I would write:

1. `feat: Create ticket.html` (Creates the file for rendering tickets)
   - Files: `ticket.html`
2. `feat: Create settings.html` (Creates the file for managing credentials)
   - Files: `settings.html`
3. `feat: Create ticket.css` (Creates the file for styling the ticket board)
   - Files: `ticket.css`
4. `feat: Create ticket.js` (Creates the JS file for fetching and rendering ticket data)
   - Files: `ticket.js`
5. `feat: Create settings.js` (Creates the JS file for saving and loading credentials)
   - Files: `settings.js`
6. `refactor: Extract fetch functions into separate file` (Moves fetch functions from `ticket.js` to `api.js` for reusability)
   - Files: `ticket.js`, `api.js`

Here's the pull request title and body:

Title: "Add ticket board and settings page for managing credentials"

Body:
```
This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.

Commits:
- feat: Create ticket.html
- feat: Create settings.html
- feat: Create ticket.css
- feat: Create ticket.js
- feat: Create settings.js
- refactor: Extract fetch functions into separate file

Please review and let me know if there are any changes that need to be made. Thank you!
```
PullRequestDescription: Parsed output
Prompt
Given the following document surrounded by `+++++`, answer the following questions. 
If the answer doesn't exist in the document, enter `null`.

+++++
Sure thing! I can definitely help with that. Here's a plan to tackle this issue:

1. Create a new file called `ticket.html` to render the tickets in a Kanban board.
2. Create a new file called `settings.html` to manage credentials for Monday.com and JIRA.
3. Create a new file called `ticket.css` to style the ticket board and settings page.
4. Create a new file called `ticket.js` to handle fetching ticket data from Monday.com and JIRA, and rendering it on the ticket board.
5. Create a new file called `settings.js` to handle saving and loading credentials for Monday.com and JIRA.

Here are the commits that I would write:

1. `feat: Create ticket.html` (Creates the file for rendering tickets)
   - Files: `ticket.html`
2. `feat: Create settings.html` (Creates the file for managing credentials)
   - Files: `settings.html`
3. `feat: Create ticket.css` (Creates the file for styling the ticket board)
   - Files: `ticket.css`
4. `feat: Create ticket.js` (Creates the JS file for fetching and rendering ticket data)
   - Files: `ticket.js`
5. `feat: Create settings.js` (Creates the JS file for saving and loading credentials)
   - Files: `settings.js`
6. `refactor: Extract fetch functions into separate file` (Moves fetch functions from `ticket.js` to `api.js` for reusability)
   - Files: `ticket.js`, `api.js`

Here's the pull request title and body:

Title: "Add ticket board and settings page for managing credentials"

Body:
```
This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.

Commits:
- feat: Create ticket.html
- feat: Create settings.html
- feat: Create ticket.css
- feat: Create ticket.js
- feat: Create settings.js
- refactor: Extract fetch functions into separate file

Please review and let me know if there are any changes that need to be made. Thank you!
```
+++++

Extract information from this document and return a JSON that follows the correct schema.


Given below is XML that describes the information to extract from this document and the tags to extract it into.


```xml
<output>
    <string name="title" description="The title of the pull request."/>
    <string name="body" description="The body of the pull request."/>
    <list name="commits" on-fail="reask" description="The commits that will be made in this pull request. Commits must change the code in the repository, and must not be empty.">
        <object>
            <string name="commit_message" description="The commit message, concisely describing the changes made." length="1 100" on-fail="noop"/>
            <list name="relevant_file_hunks" description="The files we should be looking at while writing this commit. Include files that whose contents will be called by the code in this commit, and files that will be changed by this commit.">
                <object>
                    <string name="filepath" description="The path to the file we are looking at." format="filepath" on-fail="fix"/>
                    <integer name="start_line" description="The line number of the first line of the hunk." format="positive" required="false" on-fail="noop"/>
                    <integer name="end_line" description="The line number of the last line of the hunk." format="positive" required="false" on-fail="noop"/>
                </object>
            </list>
            <string name="commit_changes_description" description="A description of the changes made in this commit, in the form of a list of bullet points." required="true" length="1 1000"/>
        </object>
    </list>
</output>
```
Raw Response
{
    "title": "Add ticket board and settings page for managing credentials",
    "body": "This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.",
    "commits": [
        {
            "commit_message": "feat: Create ticket.html",
            "relevant_file_hunks": [
                {
                    "filepath": "ticket.html"
                }
            ],
            "commit_changes_description": "- Adds ticket.html for rendering tickets."
        },
        {
            "commit_message": "feat: Create settings.html",
            "relevant_file_hunks": [
                {
                    "filepath": "settings.html"
                }
            ],
            "commit_changes_description": "- Adds settings.html for managing credentials."
        },
        {
            "commit_message": "feat: Create ticket.css",
            "relevant_file_hunks": [
                {
                    "filepath": "ticket.css"
                }
            ],
            "commit_changes_description": "- Adds ticket.css for styling the ticket board."
        },
        {
            "commit_message": "feat: Create ticket.js",
            "relevant_file_hunks": [
                {
                    "filepath": "ticket.js"
                }
            ],
            "commit_changes_description": "- Adds ticket.js for fetching and rendering ticket data."
        },
        {
            "commit_message": "feat: Create settings.js",
            "relevant_file_hunks": [
                {
                    "filepath": "settings.js"
                }
            ],
            "commit_changes_description": "- Adds settings.js for saving and loading credentials."
        },
        {
            "commit_message": "refactor: Extract fetch functions into separate file",
            "relevant_file_hunks": [
                {
                    "filepath": "ticket.js"
                },
                {
                    "filepath": "api.js"
                }
            ],
            "commit_changes_description": "- Moves fetch functions from ticket.js to api.js for reusability."
        }
    ]
}
Parsed Response
{
  "title": "Add ticket board and settings page for managing credentials",
  "body": "This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.",
  "commits": [
    {
      "commit_message": "feat: Create ticket.html",
      "relevant_file_hunks": [
        {
          "filepath": "ticket.html",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Adds ticket.html for rendering tickets."
    },
    {
      "commit_message": "feat: Create settings.html",
      "relevant_file_hunks": [
        {
          "filepath": "settings.html",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Adds settings.html for managing credentials."
    },
    {
      "commit_message": "feat: Create ticket.css",
      "relevant_file_hunks": [
        {
          "filepath": "ticket.css",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Adds ticket.css for styling the ticket board."
    },
    {
      "commit_message": "feat: Create ticket.js",
      "relevant_file_hunks": [
        {
          "filepath": "ticket.js",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Adds ticket.js for fetching and rendering ticket data."
    },
    {
      "commit_message": "feat: Create settings.js",
      "relevant_file_hunks": [
        {
          "filepath": "settings.js",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Adds settings.js for saving and loading credentials."
    },
    {
      "commit_message": "refactor: Extract fetch functions into separate file",
      "relevant_file_hunks": [
        {
          "filepath": "ticket.js",
          "start_line": null,
          "end_line": null
        },
        {
          "filepath": "api.js",
          "start_line": null,
          "end_line": null
        }
      ],
      "commit_changes_description": "- Moves fetch functions from ticket.js to api.js for reusability."
    }
  ]
}
📝 Result

Title: Add ticket board and settings page for managing credentials

This pull request adds a new ticket board for rendering tickets in a Kanban board, as well as a settings page for managing credentials for Monday.com and JIRA. The ticket board fetches data from Monday.com and JIRA, and supports showing comments. Each ticket on the board contains a link to open the original ticket in a new tab.

  1. Commit: feat: Create ticket.html
    Files: ticket.html
    Changes:
    • Adds ticket.html for rendering tickets.
  2. Commit: feat: Create settings.html
    Files: settings.html
    Changes:
    • Adds settings.html for managing credentials.
  3. Commit: feat: Create ticket.css
    Files: ticket.css
    Changes:
    • Adds ticket.css for styling the ticket board.
  4. Commit: feat: Create ticket.js
    Files: ticket.js
    Changes:
    • Adds ticket.js for fetching and rendering ticket data.
  5. Commit: feat: Create settings.js
    Files: settings.js
    Changes:
    • Adds settings.js for saving and loading credentials.
  6. Commit: refactor: Extract fetch functions into separate file
    Files: ticket.js, api.js
    Changes:
    • Moves fetch functions from ticket.js to api.js for reusability.
▶️ Implementing: feat: Create ticket.html
Deciding what action to take

Running rail MakeDecision in one step...

@github-actions github-actions bot changed the title Fix #1: Ticket overview page Add ticket board and settings page for managing credentials May 12, 2023
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.

Ticket overview page
0 participants