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

Azure Pipelines - ValueError: invalid literal for int() with base 10: '' #2517

Closed
ashokm opened this issue Apr 3, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@ashokm
Copy link
Contributor

ashokm commented Apr 3, 2023

MegaLinter v6.22.1 breaks Azure Pipelines with the changes to the AzureCommentReporter.

We're using the same configuration as the example in https://megalinter.io/latest/reporters/AzureCommentReporter/:

      - script: |
          docker run -v $(System.DefaultWorkingDirectory):/tmp/lint \
            --env-file <(env | grep -e SYSTEM_ -e BUILD_ -e TF_ -e AGENT_) \
            -e CI=true \
            -e SYSTEM_ACCESSTOKEN=$(System.AccessToken) \
            -e GIT_AUTHORIZATION_BEARER=$(System.AccessToken) \
            oxsecurity/megalinter:v6
        displayName: Run MegaLinter

Result:

[Azure Comment Reporter] Missing value SYSTEM_PULLREQUEST_PULLREQUESTID
You may need to configure a build validation policy to make it appear.
See https://docs.microsoft.com/en-US/azure/devops/repos/git/branch-policies?view=azure-devops&tabs=browser#build-validation
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/megalinter/run.py", line 15, in <module>
    linter.run()
  File "/megalinter/MegaLinter.py", line 206, in run
    reporter.produce_report()
  File "/megalinter/reporters/AzureCommentReporter.py", line 83, in produce_report
    existing_threads = git_client.get_threads(
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/azure_devops-6.0.0b4-py3.11.egg/azure/devops/released/git/git_client_base.py", line 1476, in get_threads
  File "/usr/local/lib/python3.11/site-packages/msrest-0.6.21-py3.11.egg/msrest/serialization.py", line 648, in url
    data = self._http_component_validation(data, data_type, name, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/msrest-0.6.21-py3.11.egg/msrest/serialization.py", line 635, in _http_component_validation
    data = self.serialize_basic(data, data_type, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/msrest-0.6.21-py3.11.egg/msrest/serialization.py", line 810, in serialize_basic
    return eval(data_type)(data)
           ^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
##[error]Bash exited with code '1'.

Note that this error does not seems to appear on PR builds, only on non-PR builds.

@ashokm ashokm added the bug Something isn't working label Apr 3, 2023
@ashokm
Copy link
Contributor Author

ashokm commented Apr 3, 2023

@nvuillam - Any ETAs on when #2515 will be released?

@ashokm ashokm changed the title ValueError: invalid literal for int() with base 10: '' Azure Pipeline - ValueError: invalid literal for int() with base 10: '' Apr 3, 2023
@ashokm ashokm changed the title Azure Pipeline - ValueError: invalid literal for int() with base 10: '' Azure Pipelines - ValueError: invalid literal for int() with base 10: '' Apr 3, 2023
@nvuillam
Copy link
Member

nvuillam commented Apr 3, 2023

@ashokm I'll try to release that today as it's an ugly error :)

Meanwhile you can use beta version :)

@nvuillam
Copy link
Member

nvuillam commented Apr 3, 2023

@ashokm all good with latest version:)

@nvuillam nvuillam closed this as completed Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants