Improving Contribution User Experience

Contributing to MacPorts for the first time is harder than it needs to be. We discussed an approach to simplify this for users by automating the switch to git-based source (without the long wait time to re-generate the PortIndex from scratch).

A question-and-answer based flow could look similar to this:

$> port <edit|bump> foobar
---> ${thing}ing foobar
You do not seem have a working copy of the macports-ports git repository, which
is required to contribute this change. Create one now? [Y/n]: Y<CR>

Where do you want to create your working copy? [~/macports-ports]: <CR>

The 'macports' user needs search access to ~/macports-ports to use ports in
this directory. The following directories will be changed to include 'x'
permissions for group and others:
 - /Users/$me/macports-ports
 - /Users/$me
Do you want to allow this? [Y/n]: Y<CR>

Cloning into 'macports-ports'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 1234 (delta 12), reused 18 (delta 9), pack-reused 1211
Receiving objects: 100% (1234/1234), 226.17 KiB | 66.00 KiB/s, done.
Resolving deltas: 100% (850/850), done.

Rsyncing a PortIndex file...
PortIndex ... DONE [FIXME]

Your /opt/local/etc/macports/sources.conf has been updated to use this

--->  Updating the ports tree
Synchronizing local ports tree from file:///Users/$me/macports-ports
   d5a9b153663..ef42d281820  master     -> origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to ef42d281820cde4c4ff33ed1b3b4f230734f0bd2.
Creating port index in ~/macports-ports

Total number of ports parsed:	9386
Ports successfully parsed:	9386
Ports failed:			0
Up-to-date ports skipped:	13797

Press enter to open the editor.<CR>
Improving macports contributions
Pull request guidelines
  • Check trac is actually useful
  • Port lint
  • Communicate better that not all checkboxes are required
Is port test still relevant?
  • slow, not really useful for maintainers
  • not removing it outright, some developers could depend on it
  • we just need a way to test basic binary functionality (%%blah --version%%)
Adding color support (pretty easy)
Before the pull request

Extend port bump

  • run livecheck
  • interactive!
  • Ask the user to switch to git on edit
  • Do a shallow clone
  • Check permissions
  • Update checksums
  • set revision to 0
  • build
  • search for tickets

On build failure, search for tickets

  • use new port website

Migrating from rsync to git

  • best way: migrate to git and fetch portindex
  • privilege escalation: repository is owned by root

Counting the steps needed for new users


To create a PR:

  • git clone -> edit sources -> port sync -> git checkout -b -> port edit/bump -> git commit -> fork macports-ports -> git origin add fork -> git push fork
  • 9 steps

To actually submit the PR:

  • commit cleanup (2 checklists) -> check existing trac/PR (2 checklists) -> syntax/function testing (4 checklists)
  • 8 item checklist

Things we can can do

  • (4 steps) Combine (git clone -> edit sources -> port sync -> git checkout -b) into port edit/bump
  • (3 steps) Combine all the functionality/lint testing into port test
  • (2 steps) Do the trac/PR checks automatically for user
Last modified 3 years ago Last modified on Oct 13, 2019, 10:26:44 AM