Git Product home page Git Product logo

azdevops-pull-request-utils's Introduction

Hi there ๐Ÿ‘‹

Hi, I'm Joachim! Nice of you to stop by. Let me tell you a little bit about me and what I do.

I'm a Cloud Solutions Architect specializing in Azure, Azure DevOps and .NET.

My main focus areas revolves around:

  • Infrastructure Engineering
  • Developer Experience
  • Automation

I also enjoy the challenges that comes with desiging software and infrastructure architecture.

Projects

Currently not working on anything :(

My repositories

Like many other developers I have a lot of unfinished projects and a lot of them you fill find under this project. I tend to not delete any projects, but that does not mean I will come back to them. Feel free to submit an issue on any of them if you have any questions.

Azure Certified

Identity and Access Administrator Associate Azure Security Engineer Associate Azure Developer Associate
DevOps Engineer Expert Azure Solutions Architect Expert Security, Compliance, and Identity Fundamentals

CompTIA Certified

CompTIA CTT+ Classroom Trainer

azdevops-pull-request-utils's People

Contributors

joachimdalen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

azdevops-pull-request-utils's Issues

Task is missing on Azure DevOps pipelines

Azure DevOps pipeline shows error messages below while validating yml:
image

Here is the yml content which relates to Pull Request Utils:

      - task: PullRequestDescription@0
        name: RetrievePullRequestDescription
        inputs:
          action: 'view'
          outputVariable: 'PullRequest.DescriptionContent'
          isOutput: true
          stripIdentifiers: false

Extension has confirmed to be installed and has needed permission for build service
image

image

Is there any possible that I miss something?

Rewrite and introduce V2 of tasks - deprecate V0 of tasks

This extension could use a rewrite to make maintaining it easier. Skipping V1 of tasks due to extension version 1 being used when open sourcing.

  • Rewrite and introduce V2 of the tasks
  • Add deprecation warnings to V0 tasks
    • Add option to disable warnings
  • Add migration guide between versions

PullRequest Comment Task don't set proper status

Since July, the task PullRequestComments creates a new PR comment with an invalid status Unknown in Azure DevOps.

image

With this invalid status, it's not possible to block a PR.

Task:

  - task: PullRequestComments@0
    displayName: 'Post a pull request comment reminder for checking the documentation'
    inputs:
      action: 'createOrUpdate'
      content: 'Please check if the changes on this PR needs some documentation update.'
      status: 'Active'
      commentId: 'pr-comment-documentation'
      useDefined: true
      pullRequestId: '${{ parameters.pullRequestId }}'
      type: 'System'

Task Log:

Starting: Post a pull request comment reminder for checking the documentation
==============================================================================
Task         : Pull Request Comments
Description  : Add comments to a pull request
Version      : 0.4.0
Author       : Joachim Dalen
Help         : https://docs.devops-extensions.dev/docs/extensions/pull-request-utils/tasks/pull-request-comments
==============================================================================
Finishing: Post a pull request comment reminder for checking the documentation

Open source prep tasks

  • Refactor code to use more shared implementation
  • Update documentation to use AzExt
  • Update changelog
  • Refactor webpack setup
  • Add new pipelines
  • Update README with correct environments

PullRequest.TagCheckResult is Null

Hi All,

I am using Azure DevOps https://dev.azure.com/ Classic Pipeline. We have created a branch policy which must run a build when a PR is created.

In that Build Definition, I have added below Task (exported YAML below)
steps:

  • task: joachimdalen.pull-request-utils.b5a17f8e-3729-4f73-9cae-e8c9ee69137d.PullRequestTags@0
    displayName: 'Pull Request Tags'
    inputs:
    action: check
    tag: deploy
    isOutput: true

Then in the pipeline, in the next Task I try to access variable value in Condition like
and(succeeded(), eq(variables['PullRequest.TagCheckResult'], 'true'))

When I create a PR and add a tag as deploy to that PR, when the pipeline runs, I see value of variables['PullRequest.TagCheckResult'] as Null.

What is it that I am missing here?

The log from the task is:
2022-05-23T08:36:43.0863839Z ##[section]Starting: Pull Request Tags
2022-05-23T08:36:43.0995998Z ==============================================================================
2022-05-23T08:36:43.0996479Z Task : Pull Request Tags
2022-05-23T08:36:43.0997046Z Description : Manage labels for a pull request. Gives the ability to manage pull request tags, or check if a tag is assigned.
2022-05-23T08:36:43.0997478Z Version : 0.4.0
2022-05-23T08:36:43.0997683Z Author : Joachim Dalen
2022-05-23T08:36:43.0998255Z Help : https://docs.devops-extensions.dev/docs/extensions/pull-request-utils/tasks/pull-request-tags
2022-05-23T08:36:43.0998710Z ==============================================================================
2022-05-23T08:36:47.2594109Z ##[section]Finishing: Pull Request Tags

The Condition Log is -
Evaluating: and(succeeded(), eq(variables['PullRequest.TagCheckResult'], 'true'))
Expanded: and(True, eq(Null, 'true'))
Result: False

Deprecation of this extension

First of all, let me thank those of you who have used this extension.

As you might notice, it has been a long time since this extension was updated. When this extension was under active development I was using it myself. Over the past year that has changed, and I no longer have the time it requires to properly maintain it. For that reason I will be marking this extension as deprecated and it will no longer be getting any updates. It might change in the future, but right now I can not see any time opening up in the foreseeable future.

Content from File

It would be really greate if it would be possible to use an something.md file as source for the comment content instead of providing the content inline.

PullRequestTags tests are flaky

The tests for PullRequestTags seems to be very flaky and keeps failing during test runs, a rerun normally fixes them. Tests should probably be re-written.

Create Comment on PR in different Repo fails with error

I want to update an PR as part of a build triggered by a Pull request.
The definition for the pipeline is a different repository then the PR which triggered the build.
This throws an error:


Task         : Pull Request Comments
Description  : Add comments to a pull request
Version      : 0.4.1
Author       : Joachim Dalen
Help         : https://devops-extensions.dev/docs/extensions/pull-request-utils/tasks/pull-request-comments
==============================================================================
##[debug]Using node path: /home/vsts/agents/2.217.2/externals/node10/bin/node
##[debug]agent.TempDirectory=/home/vsts/work/_temp
##[debug]loading inputs and endpoints
##[debug]loading INPUT_ACTION
##[debug]loading INPUT_SKIPIFCOMMENTEXISTS
##[debug]loading INPUT_COMMENTID
##[debug]loading INPUT_STATUS
##[debug]loading INPUT_CONTENT
##[debug]loading INPUT_USEDEFINED
##[debug]loading INPUT_PULLREQUESTID
##[debug]loading INPUT_TYPE
##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
##[debug]loaded 12
##[debug]Agent.ProxyUrl=undefined
##[debug]Agent.CAInfo=undefined
##[debug]Agent.ClientCert=undefined
##[debug]Agent.SkipCertValidation=undefined
##[debug]System.AccessToken=***
##[debug]System.TeamFoundationCollectionUri=https://dev.azure.com/xxx/
##[debug]Build.Repository.ID=70d68496-6a91-4137-a7a2-b64d01e5694e
##[debug]useDefined=false
##[debug]System.PullRequest.PullRequestId=362800
##[debug]content=This is a comment posted from pipeline CI_Ansible-lint
##[debug]skipIfCommentExists=true
##[debug]action=createOrUpdate
##[debug]type=Text
##[debug]task result: Failed
##[error]e is not iterable
##[debug]Processed: ##vso[task.issue type=error;]e is not iterable
##[debug]Processed: ##vso[task.complete result=Failed;]e is not iterable
Finishing: Post markdown comment

This is caused by following code line I think:

const repositoryId = tl.getVariable('Build.Repository.ID');

Either it should be possible to specify a different repo as a parameter, or the extension should use the pull request source repository if the build is triggered by a PR.

Update PullRequestStatus only if the status is fulfilled

We have an update PullRequestStatus task, which sets the integration tests status to the PR. In the pipeline the integration tests run in parallel.
Now we have the problem that the PullRequestStatus of the tests overwrite each other status.
We would now like to have a way to define when the update is effectively applied, in our case only when e.g. the current PullRequestStatus is set to 'pending or succeeded'.

If this is not possible, an alternative would be that the PullRequestStatus task also supports get as an action, so that we can read the status and implement our own decision logic based on it.

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.