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

PR-Agent Fails to Generate Line Links in PR Description on Azure DevOps #1558

Open
facusantillo opened this issue Feb 20, 2025 · 1 comment
Labels

Comments

@facusantillo
Copy link

Git provider (optional)

Azure

System Info (optional)

  • PR-Agent Version: codiumai/pr-agent:latest
  • Pipeline Environment: Azure DevOps (Ubuntu 22.04)
  • OpenAI API: Azure OpenAI

Issues details

PR-Agent is not generating line links for certain files in the PR description. The following warnings appear in the logs during the /describe command execution:

2025-02-20 09:11:41.225 | WARNING  | pr_agent.tools.pr_description:process_pr_files_prediction:686 - Error getting line link for '/src/config/configuration.json'
2025-02-20 09:11:41.226 | WARNING  | pr_agent.tools.pr_description:process_pr_files_prediction:686 - Error getting line link for '/configuration.toml'
2025-02-20 09:11:41.227 | WARNING  | pr_agent.tools.pr_description:process_pr_files_prediction:686 - Error getting line link for '/.azuredevops/ci-pipeline.yaml'
2025-02-20 09:11:41.227 | WARNING  | pr_agent.tools.pr_description:process_pr_files_prediction:686 - Error getting line link for '/src/app/components/menus/side-menu/side-menu.component.ts'
2025-02-20 09:11:41.228 | WARNING  | pr_agent.tools.pr_description:process_pr_files_prediction:686 - Error getting line link for '/src/app/components/menus/side-menu/side-menu.component.spec.ts'
  • The issue persists across multiple PRs and file types.
  • The Azure DevOps PAT token used has full Code (Read & Write) permissions (we are using System.AccessToken)

Also, seems like is not taking the configuration, so we are using some values in the script itself:

stages:
- stage: 'PR_Agent'
  condition: eq(variables['Build.Reason'], 'PullRequest')

  jobs:
  - job: 'Run_PR_Agent'
    displayName: 'Run PR-Agent with Azure OpenAI'
    pool:
      vmImage: 'ubuntu-22.04'
    container:
      image: codiumai/pr-agent:latest
      options: --entrypoint ""

    steps:
    - script: |
        echo "Running PR-Agent with Azure OpenAI"
        PR_URL="${SYSTEM_COLLECTIONURI}${SYSTEM_TEAMPROJECT}/_git/${BUILD_REPOSITORY_NAME}/pullrequest/${SYSTEM_PULLREQUEST_PULLREQUESTID}"
        echo "PR URL: $PR_URL"

        # Extract organization URL from System.CollectionUri
        ORG_URL=$(echo "$(System.CollectionUri)" | sed 's/\/$//') # Remove trailing slash if present
        echo "Organization URL: $ORG_URL"

        export azure_devops__org="$ORG_URL"
        export config__git_provider="azure"
        export openai__key: $(AZURE_OPENAI_API_KEY)
        export azure_devops__pat: $(System.AccessToken)
        
        # Ejecutar PR-Agent
        pr-agent --pr_url="$PR_URL" describe
        pr-agent --pr_url="$PR_URL" review
        pr-agent --pr_url="$PR_URL" improve
      displayName: 'Ejecutar PR-Agent'
      env:
        AZURE_DEVOPS.PAT: $(System.AccessToken)
        AZURE_DEVOPS.ORG: $(AZURE_DEVOPS_ORG)
        OPENAI.API_TYPE: 'azure'
        OPENAI.KEY: $(AZURE_OPENAI_API_KEY)
        OPENAI.VERSION: $(AZURE_OPENAI_API_VERSION)
        OPENAI.API_BASE: $(AZURE_OPENAI_ENDPOINT)
        CONFIG.MODEL: $(AZURE_OPENAI_MODEL)
@facusantillo facusantillo added the general label Feb 20, 2025
@facusantillo facusantillo changed the title Azure DevOps PR-Agent Fails to Generate Line Links in PR Description on Azure DevOps Feb 20, 2025
@mrT23
Copy link
Collaborator

mrT23 commented Feb 21, 2025

"get_line_link" function is currently not implemented for AzureDevops.

you are welcome to open a PR and to add support, similar to other git providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants