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

IDEFK, but you probably should have this! #239

Closed
ghost opened this issue Sep 4, 2023 · 4 comments
Closed

IDEFK, but you probably should have this! #239

ghost opened this issue Sep 4, 2023 · 4 comments
Labels
question Further information is requested

Comments

@ghost
Copy link

ghost commented Sep 4, 2023

Aider is good peeps!

Here's a wall of string you may or may not care about:

`.github\workflows\mega-linter.yml

/ls

Files in chat:

.github\workflows\mega-linter.yml

Repo files not in the chat:

.editorconfig
.gitattributes
.github\ISSUE_TEMPLATE\sweep-fast-template.yml
.github\ISSUE_TEMPLATE\sweep-slow-template.yml
.github\ISSUE_TEMPLATE\sweep-template.yml
.gitignore
.pnp.cjs
.yarn\cache\typescript-npm-5.2.2-01717e9f84-7912821dac.zip
.yarn\cache\typescript-patch-2e8dbfb8ab-0f4da2f15e.zip
.yarn\install-state.gz
.yarn\releases\yarn-3.6.3.cjs
.yarn\sdks\integrations.yml
.yarn\sdks\typescript\bin\tsc
.yarn\sdks\typescript\bin\tsserver
.yarn\sdks\typescript\lib\tsc.js
.yarn\sdks\typescript\lib\tsserver.js
.yarn\sdks\typescript\lib\tsserverlibrary.js
.yarn\sdks\typescript\lib\typescript.js
.yarn\sdks\typescript\package.json
.yarnrc.yml
config.json
dependabot.yml
favicon.ico
fonts\FontAwesome.otf
fonts\fontawesome-webfont.eot
fonts\fontawesome-webfont.svg
fonts\fontawesome-webfont.ttf
fonts\fontawesome-webfont.woff
fonts\fontawesome-webfont.woff2
images\CV.jpg
images\businesscard.jpg
images\chevron-left.png
images\corpoLogo.jpg
images\corpoPortfolio1.jpg
images\corpoPortfolio2.jpg
images\designLogo.jpg
images\designPortfolio1.jpg
images\designPortfolio2.jpg
images\flatdesk-logo-black.png
images\flatdeskLogo.svg
images\glow.jpg
images\keyboard.jpg
images\logo.jpg
images\logo.png
images\made-with-invision.png
images\photoLogo.jpg
images\photographyPortfolio1.jpg
images\photographyPortfolio2.jpg
images\postcard.jpg
images\speakermesh.jpg
images\templates\CV.psd
images\templates\businesscard.psd
index-config.html
index.html
lite.html
mailscript.php
mouse.json
package.json
scripts\app.js
scripts\directives.js
scripts\home\app.controller.js
scripts\home\configurator.controller.js
scripts\home\desktop.controller.js
scripts\home\draw.service.js
scripts\home\home.controller.js
scripts\home\home.service.js
scripts\lite.app.js
scripts\objects\businessCard.service.js
scripts\objects\cup.service.js
scripts\objects\desk.service.js
scripts\objects\desktop.service.js
scripts\objects\keyboard.service.js
scripts\objects\model.json
scripts\objects\mouse.service.js
scripts\objects\objects.module.js
scripts\objects\personalResume.service.js
scripts\objects\phone.service.js
scripts\objects\portfolio.service.js
scripts\objects\postCard.service.js
scripts\objects\speaker.service.js
scripts\objects\tableLamp.service.js
scripts\objects\tablet.service.js
scripts\scene\background.service.js
scripts\scene\light.service.js
scripts\scene\scene.module.js
styles_bootflat.scss
styles_reset.scss
styles\lite.scss
styles\main.scss
templates\businessCard\businessCard.template.html
templates\configurator.html
templates\desktop\desktop.template.html
templates\desktop\desktopHtml.template.html
templates\desktop\desktopSlides.template.html
templates\home.html
templates\personalResume\personalResume.template.html
templates\phone\phone.template.html
templates\phone\phoneHtml.template.html
templates\phone\phoneInvision.template.html
templates\phone\phoneSlides.template.html
templates\portfolio\portfolio1.template.html
templates\portfolio\portfolio2.template.html
templates\portfolio\portfolio3.template.html
templates\postCard\postCard.template.html
templates\tablet\tablet.template.html
templates\tablet\tabletHtml.template.html
templates\tablet\tabletInvision.template.html
templates\tablet\tabletSlides.template.html
yarn.lock
─────────────────────────────────────────────────────────────────────────────────────
.github\workflows\mega-linter.yml
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.MEGA_LINTER }}

  # The next four steps should always run unless the code is in a pristine state 

  - name: Create Pull Request with applied fixes
    id: cpr
    if: ${{ success() }}
    uses: peter-evans/create-pull-request@v5
    with:
      token: ${{ secrets.MEGA_LINTER }}
      commit-message: "[MegaLinter] Apply linters automatic fixes"
      title: "[MegaLinter] Apply linters automatic fixes"
      labels: bot

  - name: Create PR output
    if: ${{ success() }}
    run: |
      echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"  
      echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"        

  - name: Prepare commit
    if: ${{ success() }}
    run: sudo chown -Rc $UID .git/

  - name: Commit and push applied linter fixes
    if: ${{ success() }}
    uses: stefanzweifel/git-auto-commit-action@v4
    with:
      branch: ${{ github.event.pull_request.head.ref || github.head_ref || githu 

b.ref }}
commit_message: "[MegaLinter] Apply linter fixes"
commit_user_name: megalinter-bot
commit_user_email: nicolas.vuillamy@ox.security
token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with
the necessary permissions

  - name: Upload MegaLinter artifacts
    if: ${{ success() }}
    uses: actions/upload-artifact@v3
    with:
      name: MegaLinter reports
      path: |
        megalinter-reports
        mega-linter.log

The error message you're seeing is likely due to the `token` input not being recognized as a valid input for the `stefanzweifel/git-auto-commit-action@v4` action. 

According to the [documentation](https://github.com/stefanzweifel/git-auto-commit-action) for `stefanzweifel/git-auto-commit-action`, the correct input for the token should be `github_token`, not `token`.

Here's how you can fix this:

```yaml
.github\workflows\mega-linter.yml
<<<<<<< HEAD
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
=======
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          github_token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
>>>>>>> updated

Please apply this change to your .github\workflows\mega-linter.yml file.
Committing .github\workflows\mega-linter.yml before applying edits.
Commit c2ab9fc Apply linter fixes and upload MegaLinter reports.
Malformed response #1, retrying...
InvalidEditBlock: edit failed!

.github\workflows\mega-linter.yml does not contain the exact sequence of HEAD lines
you specified.
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The HEAD block needs to be EXACTLY the same as the lines in
.github\workflows\mega-linter.yml with nothing missing!

.github\workflows\mega-linter.yml does not contain these 9 exact lines in a row:

      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: ${{ github.event.pull_request.head.ref || github.head_ref ||       
github.ref }}
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with 
the necessary permissions

I apologize for the confusion. It seems there was a mistake in identifying the exact lines to be replaced. Let's try again.

The correct lines to replace are:

.github\workflows\mega-linter.yml
<<<<<<< HEAD
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
=======
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          github_token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
>>>>>>> updated

Please apply this change to your .github\workflows\mega-linter.yml file.
Committing .github\workflows\mega-linter.yml before applying edits.
Commit 1df56b3 Change token variable name in mega-linter.yml workflow.
Malformed response #2, retrying...
InvalidEditBlock: edit failed!

.github\workflows\mega-linter.yml does not contain the exact sequence of HEAD lines
you specified.
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The HEAD block needs to be EXACTLY the same as the lines in
.github\workflows\mega-linter.yml with nothing missing!

.github\workflows\mega-linter.yml does not contain these 9 exact lines in a row:

      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref ||       
github.ref }}
          token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with 
the necessary permissions

I apologize for the confusion. It seems there was a mistake in identifying the exact lines to be replaced. Let's try again.

The correct lines to replace are:

.github\workflows\mega-linter.yml
<<<<<<< HEAD
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
=======
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          github_token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
>>>>>>> updated

Please apply this change to your .github\workflows\mega-linter.yml file.
Malformed response #3, aborting.
─────────────────────────────────────────────────────────────────────────────────────.github\workflows\mega-linter.yml

WTF aider that the Action has to be used in a Job that runs on a UNIX system (e. g. ubuntu-latest). If you don't use the default permission of the GITHUB_TOKEN, give the Job or Workflow at least the contents: write permission.

The error message you're seeing is likely due to the token input not being recognized as a valid input for the stefanzweifel/git-auto-commit-action@v4 action.

According to the documentation for stefanzweifel/git-auto-commit-action, the correct input for the token should be github_token, not token.

Here's how you can fix this:

.github\workflows\mega-linter.yml
<<<<<<< HEAD
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          GITHUB_TOKEN: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions # Use a personal access token (PAT) with the necessary permissions
=======
      - name: Commit and push applied linter fixes
        if: ${{ success() }}
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "[MegaLinter] Apply linter fixes"
          commit_user_name: megalinter-bot
          commit_user_email: nicolas.vuillamy@ox.security
          branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
          github_token: ${{ secrets.MEGA_LINTER }} # Use a personal access token (PAT) with the necessary permissions
>>>>>>> updated

Please apply this change to your `.github\workflowsTraceback (most recent call last):
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 705, in _error_catcher
yield
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 1072, in read_chunked
self._update_chunk_length()
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 1007, in _update_chunk_length
raise InvalidChunkLength(self, line) from None
urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 932, in stream
yield from self.read_chunked(amt, decode_content=decode_content)
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 1060, in read_chunked
with self._error_catcher():
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 155, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\response.py", line 722, in _error_catcher
raise ProtocolError(f"Connection broken: {e!r}", e) from e
urllib3.exceptions.ProtocolError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Scripts\aider.exe_main
.py", line 7, in
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\main.py", line 508, in main
coder.run()
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\coders\base_coder.py", line 324, in run
new_user_message = self.run_loop()
^^^^^^^^^^^^^^^
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\coders\base_coder.py", line 403, in run_loop
return self.send_new_user_message(inp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\coders\base_coder.py", line 436, in send_new_user_message
interrupted = self.send(messages, functions=self.functions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\coders\base_coder.py", line 560, in send
self.show_send_output_stream(completion)
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\aider\coders\base_coder.py", line 635, in show_send_output_stream
for chunk in completion:
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 166, in
return (
^
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 616, in
return (
^
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\api_requestor.py", line 111, in parse_stream
for line in rbody:
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 865, in iter_lines
for chunk in self.iter_content(
File "C:\Users\kazam\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ("Connection broken: InvalidChunkLength(got length b'', 0 bytes read)", InvalidChunkLength(got length b'', 0 bytes read)) `

@TheSnowGuru
Copy link

/WTF aider is a new command :))))))

@paul-gauthier
Copy link
Collaborator

Thanks for trying aider and reporting this issue.

This looks like some sort of flakey networking error or problem with OpenAI's servers. Are you able to reproduce this, or was it a one off thing?

@paul-gauthier paul-gauthier added the question Further information is requested label Sep 5, 2023
@ghost
Copy link
Author

ghost commented Sep 6, 2023

My first day - let's chalk it up to growing pains - for my $4 in tokens, I got valuable insight into an issue I was fighting for 1.5 days.

🙏❤️

@ghost ghost closed this as completed Sep 6, 2023
@nvuillam
Copy link

nvuillam commented Sep 8, 2023

It's not so bugged as it adviced to setup MegaLinter 👼

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants