Giter VIP home page Giter VIP logo

vsts-extension's Introduction

vsts-extension

Contains the VSTS Azure DevOps Services (or TFS) extension that integrates Augurk into the Azure DevOps (Server) environment.

Build Status Release Release Status

Prerequisites

This repository requires the following to be installed on your machine:

  • NodeJS (suggest using LTS version)
  • TypeScript (npm i -g typescript)
  • Mocha (npm i -g mocha)

Contents

This extension consists of several tasks that can be used with Azure Pipelines (both build and release pipelines) which allows the user to interact with Augurk.

  • AugurkCLI: Performs a command supported by the Augurk CLI
  • AugurkCLIInstaller: Downloads and installs a specific version of the Augurk CLI onto the build agent
  • AugurkCSharpAnalyzer: Uses the Augurk.CSharpAnalyzer to perform static code analysis and uploads the results to Augurk.
  • AugurkCSharpAnalyzerInstaller: Downloads and installs a specific version of the Augurk.CSharpAnalyzer onto the build agent
  • PublishFeaturesToAugurk: A legacy PowerShell based version of the AugurkCLI task that supports versions of Augurk.CLI < 4.0.0

Build and run

To build and run a task, move into its appropriate directory (see above) and run the following commands:

tsc
node <task-name>.js

For example, to build and run the AugurkCLI task, use this command:

tsc
node cli.js

Obviously this will fail since the required inputs aren't set. These can be set by using environment variables. To discover the available inputs, check the task.json. To set the input, set an environment variable with the name INPUT_input-name. For example, to set the command to run for the Augurk CLI:

# In PowerShell
$env:INPUT_COMMAND=publish

# In Bash (or a simular shell)
export INPUT_COMMAND=publish

Running tests

In order to run tests for this project, move into the folder of the appropriate task (see above) and run the following commands:

tsc
mocha tests/_suite.js

Versioning

Important to know is that with Azure DevOps extensions there are several levels of versioning. First of all there is the version of the extension itself. We set this using GitVersion, which calculates a semantic version number based on Git history. This is done automatically by the build and release pipeline.

Additionally the build tasks themselves are also versioned, indepedently of the extension. These version numbers must be set manually when making changes to the build task in order for the new version to be used during a build or release. This is because the build tasks are cached by the build agents.

In general, when making non breaking changes (ie. no new or renamed inputs), bumping the patch version should suffice. When new features are being added that require new inputs in the task.json, but the task will continue to work without them, the minor version should be bumped. Finally, if new inputs are required, or if existing inputs are renamed, the major version should be updated. This allows users of the task to gracefully upgrade to the new version.

Testing the extension

Once satisfied with the changes, create a pull request on GitHub. This will trigger an automatic build and publishes a preview version of the extension (with a monotonically updating version number). This version is then automatically used within our own Azure DevOps organization.

The preview extension currently isn't publicly available. If there is a demand we can look at making it publicly available, or sharing it with specific accounts.

vsts-extension's People

Contributors

jmezach avatar marktaling avatar mobrockers avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

vsts-extension's Issues

Build task does not fail on error

When the command line tool throws an error, the build task just silently continues. This might not be what we want. We'll probably want to fail the task if that happens.

Groupname is required

The groupName property is required:
image

However, the task says that the property is optional:
image

Remove workaround for permission check

To get the new Augurk CLI tasks to work I've introduced a small hack to work around an issue in the Azure DevOps SDK by setting the permissions on the executable explicitly on macOS and Linux to make it work on these platforms.

Since microsoft/azure-pipelines-task-lib#421 is now merged, this workaround should no longer be needed. We' should check to see if we can indeed remove this hack.

Build task passes source directory as product description

The build task currently passes the path to the source directory to the --productDesc parameter of the command line tool when that parameter is not filled in in the build definition. This causes an error to be written to the output. Due to #2 this does not become a problem, but we should fix this anyway.

Unable to install extension due to v0.5 being present

I'm unable to install this extension because v0.5.0 is already installed in my Azure DevOps organization:
image

However, my organization does not allow me to uninstall v0.5.0 because it can't find it. (It's an organization that was ported from TFS in the past).

How can I fix this? Or could you use a different task id? (or make 0.5.0 available somehow)

Add task for CSharpAnalyzer

Add a new task to run the new Augurk.CSharpAnalyzer. We've tried integrating it with the existing tools, but this turned out to be very difficult because the analyzer does a build itself. Therefore it seems more viable to add a new VSTS/TFS build task to our existing extension that can run the CSharpAnalyzer on demand and upload the results, much like the PublishFeaturesToAugurk task does currently.

Upgrade pipelines to avoid warnings

In our build and release pipelines we're currently seeing some warnings about things that are being deprecated. We should probably upgrade our pipelines to make use of the way of doing things so we don't get the warnings any more, before things are actually deprecated and do not work anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.