Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimic wstool info output #246

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

tdenewiler
Copy link

This adds support for vcs repos that gives output similar to that from wstool info output. Related to #196 and #209.

So far, only the git client supports this type of output. If there is interest I would appreciate help with the other clients, and would be willing to devote some time to it over the next couple months to get it over the finish line.

Testing

From a workspace, run vcs repos. I created a workspace using a subset of the repositories listed in the Gist at https://gist.github.com/nuclearsandwich/71c12be27e526ef8de4e997975bdb787. Without making changes the current output is

$ vcs repos
....
Localname               S      SCM Version UID          URI                                       
---------               -      --- ------- ---          ---                                       
src/ament/ament_cmake   -      git master  65a3ad5f128e https://github.com/ament/ament_cmake.git  
src/ament/ament_index   -      git master  496403d08658 https://github.com/ament/ament_index.git  
src/ament/ament_lint    -      git master  96d9ca4fd32b https://github.com/ament/ament_lint.git   
src/ament/ament_package -      git master  6098894352c4 https://github.com/ament/ament_package.git

If one of the files is modified in ament_package this is the output.

$ vcs repos 
....
Localname               S      SCM Version UID          URI                                       
---------               -      --- ------- ---          ---                                       
src/ament/ament_cmake   -      git master  65a3ad5f128e https://github.com/ament/ament_cmake.git  
src/ament/ament_index   -      git master  496403d08658 https://github.com/ament/ament_index.git  
src/ament/ament_lint    -      git master  96d9ca4fd32b https://github.com/ament/ament_lint.git   
src/ament/ament_package M      git master  6098894352c4 https://github.com/ament/ament_package.git

If an untracked file is added (I did touch x in ament_packages) this is the output.

$ vcs repos 
....
Localname               S      SCM Version UID          URI                                       
---------               -      --- ------- ---          ---                                       
src/ament/ament_cmake   -      git master  65a3ad5f128e https://github.com/ament/ament_cmake.git  
src/ament/ament_index   -      git master  496403d08658 https://github.com/ament/ament_index.git  
src/ament/ament_lint    -      git master  96d9ca4fd32b https://github.com/ament/ament_lint.git   
src/ament/ament_package ??     git master  6098894352c4 https://github.com/ament/ament_package.git

@tdenewiler tdenewiler changed the title Mimic wstool info output [WIP] Mimic wstool info output Aug 3, 2022
@tdenewiler tdenewiler mentioned this pull request Aug 15, 2022
@tdenewiler tdenewiler marked this pull request as draft August 16, 2022 04:12
@nuclearsandwich
Copy link
Contributor

I don't have permissions to approve workflow runs on this repository but I've pushed a copy of this branch to my fork in order to run the action there https://github.com/nuclearsandwich/vcstool/actions/runs/2980535291

@tdenewiler
Copy link
Author

I don't have permissions to approve workflow runs on this repository but I've pushed a copy of this branch to my fork in order to run the action there https://github.com/nuclearsandwich/vcstool/actions/runs/2980535291

Thanks @nuclearsandwich! There are some linting issues. I will try to run the workflows on my fork (following your example) and fix those before requesting any more attention.

@tdenewiler tdenewiler closed this Sep 2, 2022
@tdenewiler tdenewiler reopened this Sep 2, 2022
@tdenewiler
Copy link
Author

Workflow was failing due to an upstream issue. Take care when reading the comments :(

tholo/pytest-flake8#87

@nuclearsandwich
Copy link
Contributor

Workflow was failing due to an upstream issue.

Yeah, in #247 I've pinned the flake8 version back so that CI is working while we figure out a strategy that will work for most of ROS Infrastructure. I plan to merge that PR into my fork's default branch tomorrow if you would like to use that as a basis for running actions on your fork or even opening a PR targeting mine you'd be welcome to do so.

With that in mind I think that it is still worth:

  1. Keeping all of the review / discussion on this pull request even if we have to link elsewhere for Actions results.
  2. Not merging my CI fixes directly into this PR branch unless you're comfortable rebasing them out once that PR is either merged or altered in order to pass review.

@tdenewiler
Copy link
Author

In the first comment I showed the workspace I am using for testing. It contains only git repositories. Does anyone have good examples of other types of ROS(2) repositories I could use as part of a testing workspace? I am looking for the following repository types:

  • bzr
  • hg
  • svn
  • tar
  • zip

@tdenewiler
Copy link
Author

Nevermind about the list of repositories of different types. There is a list.repos file in the tests directory.

@tdenewiler
Copy link
Author

example.txt

All 4 VCS types now have support. I have attached an example repos file (example.txt) that you can use to create a worksapce and see the results. Note that there might be a better way to get the bzr repo into the workspace but I am not familiar enough to know how to do that.

mkdir -p /tmp/example_ws/src
cd /tmp/example_ws
vcs import src < example.txt
mkdir src/bzr
cd src/bzr
bzr branch lp:gwibber
cd /tmp/example_ws
vcs repos

The output should look like the following.

.............
Localname               S      SCM Version    UID                                  URI                                                           
---------               -      --- -------    ---                                  ---                                                           
src/ament/ament_cmake   -      git master     799183ab9bcf                         https://github.com/ament/ament_cmake.git                      
src/ament/ament_index   -      git master     23da167ecf38                         https://github.com/ament/ament_index.git                      
src/ament/ament_lint    -      git master     bbdaa17224f3                         https://github.com/ament/ament_lint.git                       
src/ament/ament_package -      git master     122af3e498dc                         https://github.com/ament/ament_package.git                    
src/bzr/gwibber         -      bzr 1449       k6jr58pbmqk27mda                     http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/
src/hg/branch           -      hg  stable     805419729e11                         https://www.mercurial-scm.org/repo/hg-stable                  
src/hg/hash             -      hg  stable     6d79894d3460                         https://www.mercurial-scm.org/repo/hg-stable                  
src/hg/tag              -      hg  stable     067f2c53fb24                         https://www.mercurial-scm.org/repo/hg-stable                  
src/immutable/hash      -      git <detached> 377d5b3d03c2                         https://github.com/dirk-thomas/vcstool.git                    
src/immutable/tag       -      git 0.1.27     bf9ca56de693                         https://github.com/dirk-thomas/vcstool.git                    
src/svn/rev             -      svn 635        ec8ed9e5-419c-173f-15d3-ce57b7db7bff https://github.com/dirk-thomas/vcstool                        
src/vcstool             -      git master     daf389377310                         https://github.com/dirk-thomas/vcstool.git                    
src/without_version     -      git master     daf389377310                         https://github.com/dirk-thomas/vcstool.git          

@tdenewiler tdenewiler changed the title [WIP] Mimic wstool info output Mimic wstool info output Oct 19, 2022
@tdenewiler tdenewiler marked this pull request as ready for review October 19, 2022 21:27
@tdenewiler
Copy link
Author

Using the tabulate package the output should look like this.

$ vcs repos
.............
+-------------------------+--------+-----+------------+--------------------------------------+----------------------------------------------------------------+
| localname               | status | scm | version    | uid                                  | uri                                                            |
+-------------------------+--------+-----+------------+--------------------------------------+----------------------------------------------------------------+
| src/ament/ament_cmake   | -      | git | master     | 799183ab9bcf                         | https://github.com/ament/ament_cmake.git                       |
| src/ament/ament_index   | -      | git | master     | 23da167ecf38                         | https://github.com/ament/ament_index.git                       |
| src/ament/ament_lint    | -      | git | master     | bbdaa17224f3                         | https://github.com/ament/ament_lint.git                        |
| src/ament/ament_package | -      | git | master     | 122af3e498dc                         | https://github.com/ament/ament_package.git                     |
| src/bzr/gwibber         | -      | bzr | 1449       | k6jr58pbmqk27mda                     | http://bazaar.launchpad.net/~gwibber-committers/gwibber/trunk/ |
| src/hg/branch           | -      | hg  | stable     | f0a3aaa07d6a                         | https://www.mercurial-scm.org/repo/hg-stable                   |
| src/hg/hash             | -      | hg  | stable     | 6d79894d3460                         | https://www.mercurial-scm.org/repo/hg-stable                   |
| src/hg/tag              | -      | hg  | stable     | 067f2c53fb24                         | https://www.mercurial-scm.org/repo/hg-stable                   |
| src/immutable/hash      | -      | git | <detached> | 377d5b3d03c2                         | https://github.com/dirk-thomas/vcstool.git                     |
| src/immutable/tag       | -      | git | 0.1.27     | bf9ca56de693                         | https://github.com/dirk-thomas/vcstool.git                     |
| src/svn/rev             | -      | svn | 3          | ec8ed9e5-419c-173f-15d3-ce57b7db7bff | https://github.com/dirk-thomas/vcstool                         |
| src/vcstool             | -      | git | master     | daf389377310                         | https://github.com/dirk-thomas/vcstool.git                     |
| src/without_version     | -      | git | master     | daf389377310                         | https://github.com/dirk-thomas/vcstool.git                     |
+-------------------------+--------+-----+------------+--------------------------------------+----------------------------------------------------------------+

@nuclearsandwich
Copy link
Contributor

I haven't done a full review since the last time I looked but I would strongly prefer not introducing an additional dependency. I think the previous output demo was good enough and the additional package isn't required.

@tdenewiler
Copy link
Author

I reverted the use of a new dependency for printing out the results. This branch is working for me when I run it locally. That said, my workspaces are almost entirely made of git repositories so I have not done extensive testing of most of the interfaces. I did update the tests for the other VCS interfaces and those are passing, and I have an example workspace with one of each VCS type that this is working for.

If anyone has time it would be nice to get this reviewed. I think it would be a nice addition to the existing tool if we could get it published.

@tdenewiler
Copy link
Author

Just checking in to see if this can get merged? Our team internally is using this branch in a custom virtual environment more often and it would be nice if the repos verb was available in a standard install. I'm happy to help if anything else needs to be done. Thanks.

@tdenewiler
Copy link
Author

Note that teams I work on are using the following command to get access to the repos verb in our Python venvs.

pip install git+https://github.com/tdenewiler/vcstool@wstool-info-output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants