Coder Social home page Coder Social logo

action-conflict-counter's Introduction

Merge Conflict Counter

This action counts any merge conflicts in your repository.

How to use it?

Reuse the template below by placing it in your repository's workflows e.g. .github/workflow/conflicts_report.yml:

on: [pull_request]
name: 'Merge conflicts'

jobs:
  report:
    name: 'Report'
    uses: appsembler/action-conflict-counter/.github/workflows/report-via-comment.yml
    with:
      local_base_branch: 'main'  # Your repositories main/master branch name
      upstream_repo: 'https://github.com/edx/edx-platform.git'  # Upstream repository that you've forked from
      upstream_branches: 'master,open-release/maple.master'  # Upstream repository's main/master branch name
    secrets:
      custom_github_token: ${{ secrets.GITHUB_TOKEN }}

Author

Omar Al-Ithawi at Appsembler.

This action has been modified from @OliverNybroe's action-conflict-finder.

action-conflict-counter's People

Contributors

omarithawi avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

omarithawi

action-conflict-counter's Issues

publish python script to a pypi package

  • makes the script more reusable outside the context of github actions
  • allows local devstack inspection of merge conflicts
  • allows pushing the conflict reports to grafana and other tools

Hide previous github actions comments to reduce GitHub noise

Using an action

jobs:
  hide:
    steps:
      - uses: int128/hide-comment-action@5f4b3b8e995d6c0213dbd47bbfc54374839a2ae8   # @v1 on Jan 18th, 2022
        with:
          ends-with: '<!--- action-conflict-counter --->'

Manual solution

  1. List previous comments:
github.rest.issues.listComments({
  owner,
  repo,
  issue_number,
});
  1. for each comment from github actions with <!--- action-conflict-counter ---> comment hide it.
octokit.rest.issues.updateComment({
  owner,
  repo,
  comment_id,
  body,
});

request: switch to comments only

Currently, this check fails if there are conflicts detected. That makes sense.

However... during our SOC2 evaluation, one of the things the auditors did was sample a bunch of our PRs at random and check that we adhered to our controls which are basically that code being merged to "production" branches must pass tests and be reviewed. We had a few PRs where the coverage tests failed and the auditors flagged those. It's not a huge deal, I just had to send them some screenshots and write some explanations for them that the codecov/coveralls actions are flakey and we don't really consider them "tests" that we require to pass. (the auditors have access to metadata about our PRs, but not the actual code in the repos or comments, etc. so they could only see "1 failing check" or whatever).

I plan on fixing those coverage checks so they're more forgiving in the future, but I think we need to do the same for this. It's not a showstopper, but since the next time we go through the SOC2 evaluation, it will be an even longer period and they'll be sampling even more PRs, I think it's likely that they'll hit some that have a failure on this check. If we can switch this to just adding a comment on the PR with the conflict summary but not actually failing, that would eliminate some annoying back and forth and help streamline the whole process.

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.