Coder Social home page Coder Social logo

scc's Introduction

SCC

Introduction

The scc command provides tools for simplifying the Git(Hub) workflow.

Documentation

Setup and usage instructions can be found on the OME-contributing pages.

Dependencies

Direct dependencies of scc are:

Installation

To install scc, run:

$ python setup.py install

or using pip, run:

$ pip install scc

To upgrade your pip installation, run:

$ pip install -U scc

Usage

The list of available commands can be listed with:

$ scc -h

For each subcommand, additional help can be queried, e.g.:

$ scc merge -h

Contributing

PyGithub follows PEP 8, the Style Guide for Python Code. Please check your code with pep8 or flake8, the Python style guide checkers, by running flake8 -v . or pep8 -v ..

Running tests

The tests are located under the test directory. To run all the tests, use the test target of setup.py:

python setup.py test

Unit tests

Unit tests are stored under the test/unit folder and can be run by calling:

python setup.py test -t test/unit

Unit tests are also run by the Travis build on every Pull Request opened against the main repository.

Integration tests

Integration tests are stored under test/integration. Many integration tests use snoopys-sandbox and snoopys-sandbox-2 as sandbox repositories to test the scc commands.

Running the integration test suite requires:

  • a GitHub account

  • a token-based GitHub connection, i.e. a github.token stored under the local Git configuration file (a global token is ignored):

    $ git config github.token xxxx
    
  • the user authenticated by the token defined above needs to own forks of snoopys-sandbox and snoopys-sandbox-2

Once this is set up, the integration tests can be run by calling:

python setupy.py test -s test/integration

License

scc is released under the GPL.

Copyright

2012-2019, The Open Microscopy Environment

scc's People

Contributors

sbesson avatar joshmoore avatar manics avatar jburel avatar chris-allan avatar melissalinkert avatar knabar avatar rleigh-codelibre avatar dependabot[bot] avatar will-moore avatar mtbc avatar

Watchers

 avatar James Cloos avatar  avatar  avatar  avatar  avatar  avatar  avatar

scc's Issues

Refactor whitelisting logic

Much of the scc whitelisting logic was put into place as part of the merge command effort and currently lies in the GitHubRepositoryclass. As we are whitelisting more Github objects (Pull requests, comments see #125), this logic should be refactoredto be more generic.

One possibility would to wrap github.NamedUser into a scc.git.NamedUser class defining its own is_whitelisted(*args) method.

Error handling on "no common commits"

If a PR has already been rebased, the following error message appears, leaves a branch in the local repo, and one on the remote repo. This should be detected earlier and handled.

/cc @sbesson

@(2e32665...) ~/git/docs/sphinx $ ~/code/scc.git/scc.py rebase -v 158 develop
2012-12-17 09:04:41,245 DEBUG [     scc.git] Check current status
2012-12-17 09:04:41,245 DEBUG [     scc.git] Calling 'git log --oneline -n 1 HEAD'
2012-12-17 09:04:41,327 DEBUG [     scc.git] 2e32665 Merge pull request #97 from sbesson/env_makefile
2012-12-17 09:04:41,328 DEBUG [     scc.git] Calling 'git submodule status'
2012-12-17 09:04:42,750 DEBUG [     scc.git] Calling 'git config --get remote.origin.url'
2012-12-17 09:04:42,759 INFO  [     scc.git] Repository: openmicroscopy/ome-documentation
2012-12-17 09:04:42,760 DEBUG [      scc.gh] github.get_user
2012-12-17 09:04:44,279 DEBUG [      scc.gh] github.get_organization
2012-12-17 09:04:45,012 DEBUG [     scc.git] Calling 'git config --get remote.origin.url'
2012-12-17 09:04:45,022 INFO  [     scc.git] Repository: openmicroscopy/ome-documentation
2012-12-17 09:04:45,022 DEBUG [     scc.git] Get current head
2012-12-17 09:04:45,022 DEBUG [     scc.git] Calling 'git symbolic-ref HEAD' for stdout/err
2012-12-17 09:04:45,029 DEBUG [     scc.git] Get current sha1
2012-12-17 09:04:45,029 DEBUG [     scc.git] Calling 'git rev-parse HEAD' for stdout/err
2012-12-17 09:04:47,028 INFO  [  scc.rebase] PR 158: Remove webstart #9370 from limitations opened by Will Moore against dev_4_4
2012-12-17 09:04:47,028 INFO  [  scc.rebase] Head: 682be3
2012-12-17 09:04:47,731 INFO  [  scc.rebase] Merged: True
2012-12-17 09:04:47,735 DEBUG [     scc.git] Calling 'git rev-list --first-parent 682be3ff7956ab448e625f8a544f88f96cb79f5a'
2012-12-17 09:04:48,858 DEBUG [     scc.git] Calling 'git rev-list --first-parent origin/dev_4_4'
2012-12-17 09:04:48,948 INFO  [     scc.git] Branching SHA1: f21314
2012-12-17 09:04:48,948 DEBUG [     scc.git] Calling 'git rebase --onto origin/develop f21314 682be3ff7956ab448e625f8a544f88f96cb79f5a'
2012-12-17 09:04:49,618 INFO  [     scc.git] First, rewinding head to replay your work on top of it...
2012-12-17 09:04:51,328 INFO  [     scc.git] Applying: Remove webstart #9370 from limitations
2012-12-17 09:04:51,415 INFO  [     scc.git] Using index info to reconstruct a base tree...
2012-12-17 09:04:51,424 INFO  [     scc.git] M  sysadmins/limitations.txt
2012-12-17 09:04:51,504 INFO  [     scc.git] Falling back to patching base and 3-way merge...
2012-12-17 09:04:51,523 INFO  [     scc.git] No changes -- Patch already applied.
2012-12-17 09:04:51,533 DEBUG [     scc.git] New branch rebased/develop/limitations_webstart_9370 from HEAD...
2012-12-17 09:04:51,533 DEBUG [     scc.git] Calling 'git checkout -b rebased/develop/limitations_webstart_9370 HEAD'
2012-12-17 09:04:51,554 DEBUG [     scc.git] Switched to a new branch 'rebased/develop/limitations_webstart_9370'
# Created local branch rebased/develop/limitations_webstart_9370
2012-12-17 09:04:52,264 DEBUG [     scc.git] Pushing branch rebased/develop/limitations_webstart_9370 to [email protected]:joshmoore/ome-documentation.git...
2012-12-17 09:04:52,265 DEBUG [     scc.git] Calling 'git push [email protected]:joshmoore/ome-documentation.git rebased/develop/limitations_webstart_9370'
# Pushed rebased/develop/limitations_webstart_9370 to [email protected]:joshmoore/ome-documentation.git2012-12-17 09:05:20,840 DEBUG [     scc.git] To [email protected]:joshmoore/ome-documentation.git

2012-12-17 09:05:20,841 DEBUG [      scc.gh] github.get_user
2012-12-17 09:05:20,841 DEBUG [     scc.git]  * [new branch]      rebased/develop/limitations_webstart_9370 -> rebased/develop/limitations_webstart_9370
2012-12-17 09:05:22,276 DEBUG [      scc.gh] github.get_organization
2012-12-17 09:05:23,783 DEBUG [     scc.git] Checkout branch 2e326652239ca362c0a9da79b550448d68f69b9b...
2012-12-17 09:05:23,783 DEBUG [     scc.git] Calling 'git checkout 2e326652239ca362c0a9da79b550448d68f69b9b'
2012-12-17 09:05:24,991 DEBUG [     scc.git] Note: checking out '2e326652239ca362c0a9da79b550448d68f69b9b'.
2012-12-17 09:05:24,991 DEBUG [     scc.git] 
2012-12-17 09:05:24,991 DEBUG [     scc.git] You are in 'detached HEAD' state. You can look around, make experimental
2012-12-17 09:05:24,991 DEBUG [     scc.git] changes and commit them, and you can discard any commits you make in this
2012-12-17 09:05:24,992 DEBUG [     scc.git] state without impacting any branches by performing another checkout.
2012-12-17 09:05:24,992 DEBUG [     scc.git] 
2012-12-17 09:05:24,992 DEBUG [     scc.git] If you want to create a new branch to retain commits you create, you may
2012-12-17 09:05:24,992 DEBUG [     scc.git] do so (now or later) by using -b with the checkout command again. Example:
2012-12-17 09:05:24,992 DEBUG [     scc.git] 
2012-12-17 09:05:24,992 DEBUG [     scc.git]   git checkout -b new_branch_name
2012-12-17 09:05:24,993 DEBUG [     scc.git] 
2012-12-17 09:05:24,993 DEBUG [     scc.git] HEAD is now at 2e32665... Merge pull request #97 from sbesson/env_makefile
Traceback (most recent call last):
  File "/Users/moore/code/scc.git/scc.py", line 1166, in <module>
    main()
  File "/Users/moore/code/scc.git/scc.py", line 1162, in main
    ns.func(ns)
  File "/Users/moore/code/scc.git/scc.py", line 1014, in __call__
    self.rebase(args, main_repo)
  File "/Users/moore/code/scc.git/scc.py", line 1071, in rebase
    base=args.newbase, head="%s:%s" % (user, new_branch))
  File "/Users/moore/code/scc.git/scc.py", line 420, in open_pr
    return self.repo.create_pull(title, description, base, head)
  File "/usr/local/lib/python2.6/site-packages/github/Repository.py", line 435, in create_pull
    return self.__create_pull_1(*args, **kwds)
  File "/usr/local/lib/python2.6/site-packages/github/Repository.py", line 444, in __create_pull_1
    return self.__create_pull(title=title, body=body, base=base, head=head)
  File "/usr/local/lib/python2.6/site-packages/github/Repository.py", line 458, in __create_pull
    post_parameters
  File "/usr/local/lib/python2.6/site-packages/github/Requester.py", line 76, in requestAndCheck
    raise GithubException.GithubException(status, output)
github.GithubException.GithubException: 422 {u'message': u'Validation Failed', u'errors': [{u'message': u'No commits between openmicroscopy:develop and joshmoore:rebased/develop/limitations_webstart_9370', u'code': u'custom', u'resource': u'PullRequest'}]}

Race condition with ``scc rebase``

When executing scc rebase 314 foobar, the script shouts that:

#
# WARNING: PR is NOT mergeable!
#

yet

>>> import scc
>>> gh=scc.get_github(scc.get_token())
>>> pr=gh.gh_repo("openmicroscopy","openmicroscopy").get_pull(314)
>>> pr._mergeable
True

This message is adding confusion, so maybe remove it or add anti-race-condition logic?

Take "commit status" into account

There needs to be a flag to scc merge like --check-status which checks the status of the last commit (e.g. as set by travis-ci.org). The default can be strict but it must also be possible to set off and possibly something to ignore in-progress builds. (Perhaps status levels like log levels? -vvv ~ -sss)

/cc @sbesson

Relax `scc merge` for non-organization repositories

MergeCommand requires some work for non-organization repositories to allow at least the owner to merge his PRs:

sebastien@sbesson1:webtagging (master) $ scc merge --info master
2014-06-26 16:26:48,982 [   scc.merge] INFO  Listing Pull Request(s) based on master
2014-06-26 16:26:48,982 [   scc.merge] INFO  Including Pull Request(s) opened by any public member of the organization
2014-06-26 16:26:48,982 [   scc.merge] INFO  Including Pull Request(s) labelled as include
2014-06-26 16:26:48,983 [   scc.merge] INFO  Excluding Pull Request(s) labelled as exclude or breaking
2014-06-26 16:26:49,850 [   scc.merge] INFO  Repository: dpwrussell/webtagging
2014-06-26 16:26:49,850 [   scc.merge] INFO  Excluded PRs:
2014-06-26 16:26:49,851 [   scc.merge] INFO    # PR 8 dpwrussell 'Debug output for octopus and convert generators to lists' (user: dpwrussell)
2014-06-26 16:26:49,851 [   scc.merge] INFO

/cc @dpwrussell

Do not throw unnecessary remote cleaning errors in rcleanup()

When the Merge command is aborted e.g. due to Github issues, the rcleanup() function is called in the finally block of the merge() functions.

However, if the error occurred before the remotes were added, additional errors are generated when trying to remove non-existing merge remotes. This adds confusion when trying to identify the cause of the command failure.

Ideally, we would like to implement a smarter strategy for handling merge remotes where we do not exclusively rely on the login of the merge candidate PRs.

/cc @bpindelski

Re-enable integration tests

https://ci.openmicroscopy.org/view/Failing/job/SCC-merge/ has been activated due to recent failures:

=================================== FAILURES ===================================
__________________ TestMergePullRequest.testEmptyDescription ___________________

self = <test.integration.test_merge.TestMergePullRequest object at 0x36c80d0>

    def testEmptyDescription(self):

        self.pr.edit(body='')
        self.merge('--comment')
        assert self.isMerged()
        issue = self.sandbox.origin.get_issue(self.pr.number)
>       assert issue.comments == 1
E       assert 0 == 1
E        +  where 0 = <github.Issue.Issue object at 0x34e4ad0>.comments

../test/integration/test_merge.py:164: AssertionError
============== 1 failed, 61 passed, 4 skipped in 1357.68 seconds ===============

Possibly disable gc during actions

Since some of the commands run by scc are quite complicated, having git gc run in the middle can be disconcerting. We could temporarily disable it in .git/config as long as it gets re-enabled after each execution. Perhaps there's an environment variable that we could set instead.

Suggested by: @jburel

Commands for team collboration

Several commands would be good to allow quickly setting up a new repo:

  • add-all-org-repos - which would do hub remote add USER in every repo as well as add this to remotes.default
  • add-all-org-watches - which would set activate Github watching for all members of a repository.

"filter-*" branch taken as base

2016-11-07 16:08:44,809 [scc.tag-rele] INFO  Repository: ome/ome-stubs
2016-11-07 16:08:44,809 [scc.tag-rele] INFO  Created tag filter-5.3.0
2016-11-07 16:08:44,809 [scc.tag-rele] INFO
# (v)joshuas-mbp:ome-stubs jamoore$ git tag -l
filter-20161104
filter-5.3.0

Recursively add remotes of a given user

With the merge jobs being daily pushed to snoopy, it can be handy to recursively add remotes for a given user so that we can call the following:

scc add-remotes snoopycrimecop --name gh-scc --fetch
git checkout gh-scc/merge/dev_4_4/latest && git submodule update

/cc @scottlittlewood, @qidane

labelling merge build

It would be very handy to optionally narrow down how scc handles labels to merge PRs. At the moment filters based on union, would be very useful to apply intersection. This would be useful in a case where someone would like to test PR in isolation (read devspace).

Initial discussion:

  • -Iuser:#org -Elabel:!xyz (suggested)
  • -I label:xyz (AND|OR) -I label:xyz (more complicated)

scc version does not work since using yaclifw

With scc 0.6.0, the Version command is broken:

sebastien@sbesson1:ome $ pip install -U scc
Downloading/unpacking scc from https://pypi.python.org/packages/source/s/scc/scc-0.6.0.tar.gz#md5=adf742cfa0bdf88d321046da92b5a981
  Downloading scc-0.6.0.tar.gz
  Running setup.py (path:/private/var/folders/x6/s_xy92497bl4_5w0q_pbz1s80000gp/T/pip_build_sebastien/scc/setup.py) egg_info for package scc

Requirement already up-to-date: yaclifw>=0.1.2 in /usr/local/lib/python2.7/site-packages (from scc)
Requirement already up-to-date: PyGithub in /usr/local/lib/python2.7/site-packages (from scc)
Requirement already up-to-date: argparse in /usr/local/lib/python2.7/site-packages (from scc)
Installing collected packages: scc
  Found existing installation: scc 0.5.6
    Uninstalling scc:
      Successfully uninstalled scc
  Running setup.py install for scc

    Installing scc script to /usr/local/bin
Successfully installed scc
Cleaning up...
sebastien@sbesson1:ome $ scc version
0.1.2
sebastien@sbesson1:ome $

NB: this likely also applies to omego /cc @manics @joshmoore and his crazy repo

rebase: after merge conflict, provide users instructions

Like:

  • Fix error
  • git rebase --continue

Similarly, the branch should be properly named.

From @scottlittlewood,

[scott@js-macbookpro-24862 openmicroscopy (develop)]$ scc rebase 536 develop
# github.token and github.user not found.
# See `/usr/local/bin/scc token` for simpifying use.
Username or token: scottlittlewood
Enter password for http://github.com/scottlittlewood:
2013-01-18 11:44:07,285 [  scc.rebase] INFO  PR 536: Insight import location opened by Scott Littlewood against dev_4_4
2013-01-18 11:44:07,286 [  scc.rebase] INFO  Head: f8f2c5
2013-01-18 11:44:07,801 [  scc.rebase] INFO  Merged: False
2013-01-18 11:44:08,904 [     scc.git] INFO  Branching SHA1: 788eb8
2013-01-18 11:44:09,180 [     scc.git] INFO  First, rewinding head to replay your work on top of it...
2013-01-18 11:44:15,019 [     scc.git] INFO  Applying: Remove Import Location from Import Window and always show the Import Location PopUp on image selection
2013-01-18 11:44:15,120 [     scc.git] INFO  Using index info to reconstruct a base tree...
2013-01-18 11:44:15,165 [     scc.git] INFO  M    components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java
2013-01-18 11:44:15,174 [     scc.git] INFO  <stdin>:18: trailing whitespace.
2013-01-18 11:44:15,175 [     scc.git] INFO          
2013-01-18 11:44:15,177 [     scc.git] INFO  warning: 1 line adds whitespace errors.
2013-01-18 11:44:15,221 [     scc.git] INFO  Falling back to patching base and 3-way merge...
2013-01-18 11:44:15,369 [     scc.git] INFO  Auto-merging components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java
2013-01-18 11:44:15,654 [     scc.git] INFO  Applying: Remove logic around showing location as popup as we always show it as a popup window now
2013-01-18 11:44:15,783 [     scc.git] INFO  Applying: Refactor import location pane to be tab based
2013-01-18 11:44:15,912 [     scc.git] INFO  Applying: Squash some refactor bugs
2013-01-18 11:44:16,139 [     scc.git] INFO  Applying: Refactor UI related code for import location dialogue
2013-01-18 11:44:16,497 [     scc.git] INFO  Applying: Location Dialog layout compiling
2013-01-18 11:44:16,924 [     scc.git] INFO  Applying: More changes to the UI code
2013-01-18 11:44:17,061 [     scc.git] INFO  Applying: Refactor in progress, NPEs at the moment, may need to revert and try again
2013-01-18 11:44:17,191 [     scc.git] INFO  Applying: Start moving group code around
2013-01-18 11:44:17,330 [     scc.git] INFO  Applying: Group refactor in progress
2013-01-18 11:44:17,360 [     scc.git] INFO  Using index info to reconstruct a base tree...
2013-01-18 11:44:17,404 [     scc.git] INFO  M    components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java
2013-01-18 11:44:17,413 [     scc.git] INFO  <stdin>:151: trailing whitespace.
2013-01-18 11:44:17,413 [     scc.git] INFO       * @param groupsBox 
2013-01-18 11:44:17,413 [     scc.git] INFO  <stdin>:166: trailing whitespace.
2013-01-18 11:44:17,413 [     scc.git] INFO          
2013-01-18 11:44:17,413 [     scc.git] INFO  <stdin>:177: trailing whitespace.
2013-01-18 11:44:17,413 [     scc.git] INFO          
2013-01-18 11:44:17,413 [     scc.git] INFO  <stdin>:243: trailing whitespace.
2013-01-18 11:44:17,413 [     scc.git] INFO          
2013-01-18 11:44:17,413 [     scc.git] INFO  <stdin>:249: trailing whitespace.
2013-01-18 11:44:17,414 [     scc.git] INFO          
2013-01-18 11:44:17,416 [     scc.git] INFO  warning: squelched 2 whitespace errors
2013-01-18 11:44:17,416 [     scc.git] INFO  warning: 7 lines add whitespace errors.
2013-01-18 11:44:17,496 [     scc.git] INFO  Falling back to patching base and 3-way merge...
2013-01-18 11:44:17,634 [     scc.git] INFO  Auto-merging components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java
2013-01-18 11:44:17,634 [     scc.git] INFO  CONFLICT (content): Merge conflict in components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java
2013-01-18 11:44:17,643 [     scc.git] INFO  Failed to merge in the changes.
2013-01-18 11:44:17,651 [     scc.git] INFO  Patch failed at 0010 Group refactor in progress
2013-01-18 11:44:17,651 [     scc.git] INFO  
2013-01-18 11:44:17,651 [     scc.git] INFO  When you have resolved this problem run "git rebase --continue".
2013-01-18 11:44:17,651 [     scc.git] INFO  If you would prefer to skip this patch, instead run "git rebase --skip".
2013-01-18 11:44:17,651 [     scc.git] INFO  To check out the original branch and stop rebasing run "git rebase --abort".
2013-01-18 11:44:17,651 [     scc.git] INFO  
Traceback (most recent call last):
  File "/usr/local/bin/scc", line 1383, in <module>
    main()
  File "/usr/local/bin/scc", line 1378, in main
    ns.func(ns)
  File "/usr/local/bin/scc", line 1161, in __call__
    self.rebase(args, main_repo)
  File "/usr/local/bin/scc", line 1188, in rebase
    branching_sha1[0:6], pr_head)
  File "/usr/local/bin/scc", line 725, in rebase
    "%s" % newbase, "%s" % upstream, "%s" % sha1)
  File "/usr/local/bin/scc", line 593, in call_info
    return self.wrap_call(self.infoWrap, *command, **kwargs)
  File "/usr/local/bin/scc", line 609, in wrap_call
    raise Exception("rc=%s" % rc)
Exception: rc=1
[scott@js-macbookpro-24862 openmicroscopy ((ca363a7...)|REBASE)]$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/LocationDialog.java
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUI.java
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#    both modified:      components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java
#
[scott@js-macbookpro-24862 openmicroscopy ((ca363a7...)|REBASE)]$ git rebase --continue
components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
[scott@js-macbookpro-24862 openmicroscopy ((ca363a7...)|REBASE)]$ git add .
[scott@js-macbookpro-24862 openmicroscopy ((ca363a7...)|REBASE)]$ git status
# Not currently on any branch.
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/LocationDialog.java
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterComponent.java
#    modified:   components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/view/ImporterUI.java
#
[scott@js-macbookpro-24862 openmicroscopy ((ca363a7...)|REBASE)]$ git rebase --continue
Applying: Group refactor in progress
Applying: Importer dialog now shows as groups are passed through
Applying: Loading Groups, projects & datasets into comboboxes, resolvec close button bug
Applying: Tab swap work in progress, need to wqork out hostObject type
Applying: Group switch in progress
Applying: Group change property fired
Applying: Group change property fired
Applying: Group switching in LcoationDialog now implemented and Project / Dataset updates
Applying: Code cleanup, remove unused irrelevant variables + code from group selection code
Applying: Import Settings classes defined, WIP
Applying: Improved jdocs for import settings
Applying: Fix buidl error
Applying: Resolve chaning of group issue in tree hierarchy
Applying: Improve the jdocs for the dialogs & refactor some of the code to be more readable
Applying: Started work on swapping tabs between Projects&Screens
Applying: Rewire the switching of groups & project -> screens. Reconnect the create project/dataset/screen event
Applying: Minor fixes
Applying: Add refresh button and address layout
Applying: More UI fixes, window size is better, added padding to LocationDialog
Applying: Change button variable names to be more explicit
Applying: Change combobox changes to be monitored through ItemLisener and not actionListener
Applying: Remove old actionlistener code paths, cleanup the actionPerformed function
Applying: Clear up tab switching to help isolate swapping groups & tabs bugs
Applying: Remove the file filter switching that occured in the chooser based on Project/Screen import
Applying: Remove unused code paths & cleanup code
Applying: More code cleanup
Applying: Improve the documentation, organisation & naming of variables/constants
Applying: Remove unused imports
Applying: Improve code organisation, limit line length, extract text constants
Applying: Reorganise string constants
Applying: Improve ImportDialog text constants & code
Applying: Remove unused code and reorganise for readability
Applying: Resolve showing Debug Tab pane issues
Applying: Code cleanup & string constant extraction
Applying: String constant extraction
Applying: Start of Advanced Panel with File Naming
Applying: Resolve compile issue & long  / int cast exception on refresh button
Applying: Remove Advanced Import Location pane, Refactor TableLayouts to be more consistent, add some docs, more to come
Applying: Improve the javadocs
Applying: Remove unused variable
Applying: Re-add the refresh file chooser button, imrpove docs, remove buttons that have always been unused
Applying: Select the correct pane Screen/Project on Import
Applying: Fix the ordering of combobox items, cleanup some associated code
Applying: Move refresh buttons to buttom panel, doc tidy up, code cleanup
Applying: Remove unused index variable
Applying: Improve java docs for ImportSettings objects and change method visibility modifiers
Applying: Remove unused code
Applying: Move the refresh buttons
Applying: Move the Close and Refresh buttons on ImportDialog to be consistant with LocationDialog
Applying: Add enable/disable controls while loading or switching containers
Applying: Resolve spelling mistake in javadocs
Applying: Restore the active file filter on refresh
Applying: Refactor enable/disable code and add docs
Applying: Resolve compile issues
Applying: Minor Changes
Applying: Refactor findWithGroupId to be generic & start work on loading display data differently
Applying: Major refactor to improve code and legibility
Applying: Fixes issue with refresh button not loading the datasets, needed to call getDisplayChildren()
Applying: Implement retaining current selections when swapping tabs or refreshing
Applying: Remove old unused code & add java docs
Applying: Resolve line length issues & add missing javadocs
Applying: More javadoc issues resolved
Applying: Resolve user switching in Insight
Applying: Resolve the issue around switching user when running Importer as master agent
Applying: Remove unused import in ImporterAgent
Applying: Set enabled flag when switching group.
Applying: Add Discard to state check of model before clearing up
Applying: Clear up imports
Applying: Clear up Importer Menu in Window menu option on switching user
Applying: Add javadoc to loadGroups()
Applying: Remove old commented out code
Applying: Type check error
[scott@js-macbookpro-24862 openmicroscopy ((963a3ae...))]$ git status
# Not currently on any branch.
nothing to commit (working directory clean)

--no-ask still leads to bad credentials.

@unrebased-prs ~/code/scc.git $ (cd ~/git; ~/code/scc.git/scc.py unrebased-prs dev_4_4 develop -v --no-ask)
2013-02-08 10:17:19,307 [  scc.config] DEBUG Found github.user
Bad credentials

Likely until something requires credentials (push), we should fall back to an unauthenticated connection.

Add documentation for scc tests/CI job

Documentation should be added to the repository to:

  • explain how integrations are set up, including the github.token requirements
  • explain the Travis build and the tests which should be performed there
  • add a link to the daily merge job running the scc integration test suite

/cc @mtbc

Automatically fetch PRs for rebase if not already merged

Rebase an unmerged PR, this will fail if that commit hasn't already been fetched:

$ scc rebase 5460 metadata53
2017-08-22 17:26:48,640 [  scc.rebase] INFO  PR 5460: allow model types to be ignored during object deletion opened by Mark Carroll against develop
2017-08-22 17:26:48,641 [  scc.rebase] INFO  Head: 338362
2017-08-22 17:26:49,047 [  scc.rebase] INFO  Merged: False
Commit 338362bd08634334a2198997bf89c95a029171d7 does not exists in local Git repository. Fetch this remote first: mtbc

Since it is possible to fetch PRs from origin without needing to add a remote scc should automatically fetch pull/<PR>/head:

$ git fetch origin pull/5460/head
remote: Counting objects: 23, done.
remote: Total 23 (delta 19), reused 19 (delta 19), pack-reused 4
Unpacking objects: 100% (23/23), done.
From https://github.com/openmicroscopy/openmicroscopy
 * branch                  refs/pull/5460/head -> FETCH_HEAD

$ scc rebase 5460 metadata53
2017-08-22 17:30:24,671 [  scc.rebase] INFO  PR 5460: allow model types to be ignored during object deletion opened by Mark Carroll against develop
...
# Created local branch rebased/metadata53/delete-ignore-types
# Pushed rebased/metadata53/delete-ignore-types to manics
https://github.com/openmicroscopy/openmicroscopy/pull/5464

prs_not_in_milestone.py

I used the following script (prs_not_in_milestone.py) to determine what PRs hadn't been placed in milestone 4.4.5:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# Copyright (C) 2012 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
#51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

"""
Module documentation
"""

import os
import sys
import github
import subprocess

org_name = os.environ.get("ORG_NAME", "openmicroscopy")

def list_prs(repo_name="openmicroscopy", start_tag="v.4.4.4", milestone_name="4.4.5"):

    print "PRs in git"
    p = subprocess.Popen("git one --first-parent %s...origin/dev_4_4" % start_tag,
            shell=True,
            stdout=subprocess.PIPE)
    p.wait()
    o = p.communicate()[0]

    gitprs = set()
    drop = len("Merge pull request #")
    for line in o.split("\n"):
        idx = line.find("Merge pull request")
        if idx >= 0:
            rest = line[idx+drop:]
            try:
                pr = int(rest.split(" ")[0])
            except:
                raise Exception(line)
            print pr
            gitprs.add(pr)

    gh = github.Github()
    org = gh.get_organization(org_name)
    repo = org.get_repo(repo_name)
    miles = repo.get_milestones(state="closed")
    mile = [m for m in miles if m.title == milestone_name][0]
    issues = repo.get_issues(milestone=mile, state="closed")

    print "PRS in github"

    ghprs = set()
    for i in issues:
        print i.number
        ghprs.add(i.number)

    print "PRs needing labelling"
    for x in gitprs.difference(ghprs):
        print "open http://github.com/%s/%s/pull/%s" % (org_name, repo_name, x)

if __name__ == "__main__":
    list_prs(*sys.argv[1:])

Usage includes:

@(v4.4.4) ~/git/components/bioformats $ ../../prs_not_in_milestones.py bioformats v4.4.4
@(439ad58...) ~/git/components/tools/OmeroPy/scripts $ ORG_NAME=ome ../../../../prs_not_in_milestones.py scripts 439ad5888dc53035604810214c3bfd8aa5a3430f
@(2e32665...) ~/git/docs/sphinx $ ../../prs_not_in_milestones.py ome-documentation 2e326652239ca362c0a9da79b550448d68f69b9b
~/git $ ./prs_not_in_milestones.py 

Fix scc to work with repos where issues are disabled

The current implementation of scc, especially the PullRequest object assumes issues are activated by a repository and that each PR has a corresponding issue. By default, issues are disabled for e.g. fork repositories.
The code should be modified to allow commands to work with repos without issues, for instance we could catch the following exception:

GithubException: 410 {u'documentation_url': u'http://developer.github.com/v3/issues/', u'message': u'Issues are disabled for this repo'}

Consistently use --remote across the board

From @qidane,

2013-01-24 11:28:00,767 [     scc.git] DEBUG Calling 'git remote'
2013-01-24 11:28:00,772 [     scc.git] DEBUG cd /Users/andrew/Work/ome

Failed to find remote: origin.
Available remotes: gh, gh-ome can be passed with the --remote argument.
[andrew@voile ~/Work/ome]$ scc merge master --info -v --remote gh-ome
usage: scc [-h] {merge,rebase,version,clean-sandbox,token} ...
scc: error: unrecognized arguments: --remote gh-ome
[andrew@voile ~/Work/ome]$

the --remote option is suggested in the error message but only implemented in the Rebase command. We should fix this by either allowing --remote to be passed for any command initalizing a GitRepository or disabling it.

unicode fun

when coping and pasting commit massage to https://github.com/aleksandra-tarkowska/openmicroscopy/commit/3091e4c it turned out that ... appeared as non ASCII character. When scc merge develop I had an error:

2014-09-09 11:20:36,796 [   scc.merge] INFO  Excluding Pull Request(s) labelled as exclude or breaking
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/scc/main.py", line 72, in entry_point
    (UpdateSubmodules.NAME, UpdateSubmodules),
  File "/Library/Python/2.7/site-packages/scc/framework.py", line 186, in main
    ns.func(ns)
  File "/Library/Python/2.7/site-packages/scc/git.py", line 2511, in __call__
    updated = self.merge(args, self.main_repo)
  File "/Library/Python/2.7/site-packages/scc/git.py", line 2544, in merge
    set_commit_status=args.set_commit_status)
  File "/Library/Python/2.7/site-packages/scc/git.py", line 1326, in rmerge
    set_commit_status=set_commit_status)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1089: ordinal not in range(128)

Might be worth to get some support for unicode

Don't recursively merge branches

scc merge dev_4_4 --comment -Dnone -Imanics/snoopys-sandbox:added-2 will attempt to merge manics/snoopys-sandbox:added-2 into the main (expected) and submodule repo (oops).

Add support for Unicode characters in PullRequest object

From http://hudson.openmicroscopy.org.uk/view/Docs/job/OMERO-docs-merge-stable/519/console

2013-10-11 18:12:09,378 [     scc.git] DEBUG Calling 'git remote rm merge_mtbc'
Traceback (most recent call last):
  File "/home/LIFESCI-AD/hudson-x/virtualenv/bin/scc", line 8, in <module>
    load_entry_point('scc==0.4.0', 'console_scripts', 'scc')()
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/main.py", line 58, in entry_point
    (UpdateSubmodules.NAME, UpdateSubmodules),
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/framework.py", line 186, in main
    ns.func(ns)
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/git.py", line 1912, in __call__
    updated = self.merge(args, self.main_repo)
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/git.py", line 1944, in merge
    set_commit_status=args.set_commit_status)
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/git.py", line 1181, in rmerge
    set_commit_status=set_commit_status)
  File "/home/LIFESCI-AD/hudson-x/virtualenv/lib/python2.6/site-packages/scc/git.py", line 1077, in merge
    merge_msg += str(conflicting_pull) + "\n"
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2192' in position 29: ordinal not in range(128)

sec commands should support Unicode characters in the PR title/body/description.
/cc @mtbc

Improve scc token help

See http://trac.openmicroscopy.org/ome/ticket/10902

@mtbc reports:

$ scc token create
Traceback (most recent call last):
  File "/usr/local/bin/scc", line 8, in <module>
    load_entry_point('scc==0.3.4', 'console_scripts', 'scc')()
  File "/Library/Python/2.7/site-packages/scc.py", line 2195, in entry_point
    main()
  File "/Library/Python/2.7/site-packages/scc.py", line 2186, in main
    ns.func(ns)
  File "/Library/Python/2.7/site-packages/scc.py", line 1860, in create
    raise Exception("No github.user configured")
Exception: No github.user configured

It's far from clear from scc's help how to create a github.user token. A suggestion to use git config --global github.user would be helpful when this exception is thrown.

"List my PRs" command

scc list-prs --assigned=me or similar (possibly re-using the parsing done for gh-39) should be available. Optimally, it would find all of your organizations (and all of the repos to which you've been added) and then list all PRs which were created, assigned, etc. to you, possibly listing open versus closed ones.

The first goal would be to print out the urls of all the PRs which have been assigned to me which are still open so that I can review them first thing in the morning as a replacement/extension of the standup.

/cc @sbesson

Rebase improvements

Several usability improvements are possible for the rebase command to catch exceptional situations`:

  • Add --fetch or alternatively --no-fetch options for rebase
  • Check local status (modified files) before rebasing

Minor RFE: list latest commit in merge messages

Merged PRs:
  # PR 1969 melissalinkert 'ScreenReader: the next generation'
  # PR 1976 joshmoore 'Flex NPE'
  # PR 1990 simleo 'FileStitcher: call setId on all readers in ExternalSeries'
  # PR 1995 melissalinkert 'ScanR: return blank planes instead of skipping missing wells'
  # PR 2006 joshmoore 'Temporarily disable DeltavisionReader for IDR'

could benefit by having the short sha1s at the end:

  # PR 1969 melissalinkert 'ScreenReader: the next generation (3e3cbf9b)

More flexible submodule URL support

See #228 (comment)

The pattern used for replacing the submodule URL expects it to be ending with .git. This naming scheme is not a requirement and will cause problems when submodules are added without it, causing stale commits for fresh checkouts.

Addressing this issue should mostly be about finding a more generic pattern covering the various use cases.

Invalid symmetric difference expression

$ /home/omero/.local/bin/scc merge develop --no-ask --reset --shallow -v -S success-only --push develop_merge_trigger
...
13:11:31 2019-01-31 13:11:31,705 [     scc.git] DEBUG Calling 'git diff --name-only HEAD...65aead19a071e6359e1056e8b860f80f11865494'
13:11:31 2019-01-31 13:11:31,713 [   scc.merge] DEBUG Cleaning remote branches created for merging
13:11:31 2019-01-31 13:11:31,713 [     scc.git] DEBUG Calling 'git remote'
13:11:31 2019-01-31 13:11:31,717 [     scc.git] WARNI Repository missing: olatarkowska
13:11:31 2019-01-31 13:11:31,717 [     scc.git] DEBUG Calling 'git remote rm merge_manics'
13:11:31 2019-01-31 13:11:31,748 [     scc.git] DEBUG Calling 'git remote rm merge_joshmoore'
13:11:31 2019-01-31 13:11:31,791 [     scc.git] DEBUG Calling 'git remote rm merge_will-moore'
13:11:31 2019-01-31 13:11:31,831 [     scc.git] DEBUG Calling 'git remote rm merge_kouichi-c-nakamura'
13:11:31 Traceback (most recent call last):
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/main.py", line 80, in entry_point
13:11:31     (UpdateSubmodules.NAME, UpdateSubmodules),
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/yaclifw/framework.py", line 188, in main
13:11:31     ns.func(ns)
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 3180, in __call__
13:11:31     self.merge(args, self.main_repo)
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 3210, in merge
13:11:31     set_commit_status=args.set_commit_status)
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1793, in rmerge
13:11:31     set_commit_status=set_commit_status)
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1523, in merge
13:11:31     files = self.list_merged_files(pullrequest.get_sha())
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1423, in list_merged_files
13:11:31     "git", "diff", "--name-only", "%s...%s" % (upstream, sha))
13:11:31   File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1092, in communicate
13:11:31     raise Exception(msg)
13:11:31 Exception: Failed to run 'git diff --name-only HEAD...65aead19a071e6359e1056e8b860f80f11865494'
13:11:31     rc:     128
13:11:31     stdout: 
13:11:31     stderr: fatal: Invalid symmetric difference expression HEAD...65aead19a071e6359e1056e8b860f80f11865494
13:11:31 
13:11:31 Build step 'Execute shell' marked build as failure
13:11:31 Finished: FAILURE```

Remove all calls to os.chdir

See gh-115

All calls to os.chdir should be handled in a consistent manner, most likely via a decorator on any function that requires to be in a particular location.

Revoked tokens lead to odd messages

I removed all my SCC tokens today, and on trying to login I found:

$ ~/code/scc.git/scc.py merge -Dnone dev_4_4 --reset
Enter password for http://github.com/72xxxx
$ scc token --all
[local] github.token=72xxxx
[user] github.user=joshmoore

Don't know if it is possible to detect the difference between a non-user and a bad-token.

/cc @sbesson

merge_collab tool

Scenario: two developers are working tightly (simultaneously) on a single branch. Pushing commits quickly. Often they will be push -fing and similar. They need a tool to keep the branch properly rebased.

Solution: There should be a scc command to rebase/merge the two branches taking all of my commits from my branch, and all of my colleague's commits from my colleague's branch (in the right order)

Wrap all gh calls to handle socket.timeout

During github connectivity issues:

Traceback (most recent call last):
  File "/Users/moore/code/scc.git/scc.py", line 1298, in <module>
    main()
  File "/Users/moore/code/scc.git/scc.py", line 1294, in main
    ns.func(ns)
  File "/Users/moore/code/scc.git/scc.py", line 942, in __call__
    main_repo = self.gh.git_repo(self.cwd, False)
  File "/Users/moore/code/scc.git/scc.py", line 194, in git_repo
    return GitRepository(self, os.path.abspath(path), *args, **kwargs)
  File "/Users/moore/code/scc.git/scc.py", line 459, in __init__
    self.origin = gh.gh_repo(repo_name, user_name)
  File "/Users/moore/code/scc.git/scc.py", line 186, in gh_repo
    return GitHubRepository(self, username, reponame)
  File "/Users/moore/code/scc.git/scc.py", line 396, in __init__
    self.repo = gh.get_user(user_name).get_repo(repo_name)
  File "/usr/local/lib/python2.6/site-packages/github/Github.py", line 59, in get_user
    None
  File "/usr/local/lib/python2.6/site-packages/github/Requester.py", line 73, in requestAndCheck
    status, headers, output = self.requestRaw(verb, url, parameters, input)
  File "/usr/local/lib/python2.6/site-packages/github/Requester.py", line 106, in requestRaw
    requestHeaders
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 874, in request
    self._send_request(method, url, body, headers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 911, in _send_request
    self.endheaders()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/httplib.py", line 1072, in connect
    sock = socket.create_connection((self.host, self.port), self.timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 512, in create_connection
    raise error, msg
socket.timeout: timed out

Restructure scc

Similar to the omego restructuration performed in ome/omego#10, scc should be refactored as a proper Python packages, i.e.

scc/
     __init__.py
     main.py
     github.py
     version.py

On top of exposing the same framework as omega (so that it may be easier to extract as a standalone package), this should allow files to be installed at the right place during pip install scc.

Return code for unrebased-PRs should reflect status

The SCC-unrebased-pr job should be able to not send any emails unless the job is "unstable". It should only be unstable if PRs are found that have not been rebased, and the easy way to do this is to return the number of founds PRs as the RCode. 0==none==success.

(If possible, it would be nice to have zero stdout, but that would also require dropping the hudson ++ prefix from each line of execution)

Extend --check-commit-status granularity

Speaking with @hflynn, we need to have put extra granularity in the --check-commit-status logic implemented in #101.

The proposal at this point is to have a list of explicit keywords:

  • --check-commit-status none should not care about the commit status for PR inclusions
  • --check-commit-status no-error/no-failure should accept any state but a "failure" and/or "error" (both?), i.e. including PRs in "pending" state or without status
  • --check-commit-status success-only should only accept PRs with a "success" commit state effectively matching the --check-commit-status option of #101

A concrete application of these various states should be the following:

  • default value for daily doc builds should be success-only
  • a choice parameter should be implemented in Jenkins interface to allow the state to be modified. This means quick fix PRs which have not been Travis validated yet can be built and deployed for immediate review.

scc should have better support for use against external repos

When managing a fork of an external repo it would be nice to use scc to merge individual upstream PRs into the fork. At present scc merge -D none fetches all PRs, and all are mentioned as excluded in the merge commit message. This is impractical, both in terms of the time taken to fetch all PRs, and the length of the merge commit message, when an external repo contains ~100+ PRs.

Merge commit message not listing all merged PRs

When reviewing #144 and trying to see if all PRs have been merged in https://github.com/snoopycrimecop/snoopycrimecop/tree/merge/master/latest, I noticed that the commit message that should list two PRs (144 and 145) only lists 145. The build that handled the merging and pushing to github (http://ci.openmicroscopy.org/view/Mgmt/job/SCC-self-merge/256/) had both PRs listed in the output of scc.

@sbesson mentioned that it might be related to: "there is no summary commit as we don't have submodules to bump!"

SCC assumes a PR's repo name is the same as upstream

E.g. ome/ome-docker#1

upstream https://github.com/ome/docker/
PR branch: https://github.com/manics/omedocker/tree/remove_omedocker

2014-11-20 11:43:58,185 [     scc.git] DEBUG ## Unique users: set([u'manics'])
2014-11-20 11:43:58,185 [     scc.git] DEBUG Calling 'git remote add merge_manics git://github.com/manics/docker.git'
2014-11-20 11:43:58,188 [     scc.git] DEBUG Fetching remote merge_manics...
2014-11-20 11:43:58,189 [     scc.git] DEBUG Calling 'git fetch merge_manics'

2014-11-20 11:43:58,375 [     scc.git] DEBUG fatal: remote error: 
2014-11-20 11:43:58,375 [     scc.git] DEBUG   Repository not found.
2014-11-20 11:43:58,375 [   scc.merge] DEBUG Cleaning remote branches created for merging
2014-11-20 11:43:58,375 [     scc.git] DEBUG Calling 'git remote'
2014-11-20 11:43:58,378 [     scc.git] DEBUG Calling 'git remote rm merge_manics'

Remove py26 warnings

/Library/Python/2.6/site-packages/argparse.py:713: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
/Library/Python/2.6/site-packages/argparse.py:720: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  return format % dict(message=self.message,
usage: scc [-h] {merge,rebase,clean-sandbox,toke

Refactor excluded_pulls dictionary

See #182 (comment)

To achieve this idea, some refactoring needs to happen to:

  • define the excluded_pulls dictionary as an attribute of the object level rather than a local method variable
  • allow find_candidate_pulls, merge and other methods to fill this dictionary with PRs and various exclusion reasons (status, filter, conflict...)
  • use this dictionary when generating the merge_message in order to generate a single exclusion section

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.