[Question] Pipeline code to read the exe copied locally

Open
#743 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
azure, powershell
Domain
api, devops

Research direction

Review the checkout and publish steps for the blueprints and apidefinitions artifacts, then inspect the Fetch Extractor and Run extractor tasks and their CONFIGURATION_YAML_PATH setting. Reproduce the pipeline failure and verify that the extractor can locate apidefinitions/extractor.configuration.yaml from the reported workspace path.

Written by the indexing model from the issue text.

Description

Release version

APIOps Toolkit v6.0.1.4

Question Details

I am trying to import the exe and copy it to the pipeline workspace from where the extractor or publisher can read it from. The extractor iexe is running fine but it is not able to find the rest of the api definitions that I have also placed in the same workspace.
The code to checkout both the exe and the api definition files are:
- checkout: 'git://Project/apiops-blueprints'
path: blueprints // this is where exe resides
- checkout: 'git://Project/$(apimRepositoryName)'
path: apidefinitions
- publish: '$(Pipeline.Workspace)/blueprints'
displayName: 'Publish Blueprints'
artifact: blueprints
- publish: '$(Pipeline.Workspace)/apidefinitions'
displayName: 'Publish APIDefinitions'
artifact: apidefinitions
In the 'Fetch Extractor' powershell task, I have the following command:
$executableFilePath = Join-Path "$(Pipeline.Workspace)/blueprints/apim/extractor/binaries/$(apiops_release_version)/extractor-win-x64/" "extractor.exe"
And the environment variable I am setting is as follows:
CONFIGURATION_YAML_PATH: apidefinitions/$(configurationYamlPath)

The Fetch Extractor works fine but the pipeline fails on 'Run extractor' task, with the following error:
##[error]Unhandled exception. System.IO.FileNotFoundException: The configuration file 'apidefinitions/extractor.configuration.yaml' was not found and is not optional. The expected physical path was 'D:\a\1\s\apidefinitions\extractor.configuration.yaml'.

I have also tried using '../' in the CONFIGURATION_YAML_PATH env variable but it results in the same error.
Is there any better way to do this? The requirement is to be able to simply checkout the exe from devops and place it in the build agent so that extractor tool can access it. Thanks

Expected behavior

The requirement is to be able to simply checkout the exe from devops and place it in the build agent so that extractor tool can access it. Thanks

Actual behavior

The Fetch Extractor works fine but the pipeline fails on 'Run extractor' task, with the following error:
##[error]Unhandled exception. System.IO.FileNotFoundException: The configuration file 'apidefinitions/extractor.configuration.yaml' was not found and is not optional. The expected physical path was 'D:\a\1\s\apidefinitions\extractor.configuration.yaml'.

Reproduction Steps
  1. Checkout the exe
  2. Set up the environment variable with the location of exe and location of config file.
  3. Run the pipeline.
Dominant language
C#
Stars
448
Forks
247
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/apiops

All issues in Azure/apiops

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.