Some Quality of Life Changes (Fiss)

It's been over a year since there were any major changes to fiss, mostly because it did the minimum functionality we wanted and there are no other reported issues. However, that isn't to say it was perfect or not filled with bugs (you know, like fiss group list throwing a panic because it was never implemented).

Since we had a little time to work on something, we decided to address some quality of life issues that will hopefully make it more pleasant.

Progress Bars

When fiss is pointed to large collections of repositories, like Dylan's fiction sites, there are hundreds of repositories. When running fiss cache sync, it would take significant time to run because it walks through every server, group, and project that user is subscribed to. For us, we have hundreds and this takes a while because our server isn't that fast.

To give some feedback, instead of showing nothing for 30-90 seconds, we implemented a nested progress bar that shows the process.

$ fiss cache sync
sync_server_by_name server_name="mfgames"                                                                 3.9s
  ↳ sync_group_by_names server_name="mfgames" group_name="fedran-sources"                                 1.8s
    ↳ sync_project_by_names server_name="mfgames" group_name="fedran-sources" project_name="a-simple-cog" 0.1s

This only shows up if the command is entered into a terminal but it can be disabled with --show-progress never. In addition, always forces it to run even outside of a terminal, and auto does its best guess to determine if it is attached to a terminal or not.

The output isn't “pretty” but it is functionality for our purposes. The output is sent to “standard error” so redirect a command to get the JSON output won't be polluted by the output, even if --show-progress always is used. (Likewise, all console logging is also always sent to standard error for the same reason.)

More Intelligent Syncing

The above was written to help debug the one feature we were working on: being more graceful about how we sync our information with the forge. Previously, the only way to get a fresh list of issues was to use the fiss cache sync command which took some time.

$ time fiss cache sync --forge-sync always

real	0m46.598s
user	0m5.533s
sys	0m0.397s

If you can't guess from the spoiler, we have the same options: auto, never, and always implemented here.

$ time fiss cache sync --forge-sync never

real	0m3.127s
user	0m3.077s
sys	0m0.104s

It still walks through the servers and projects, but shaving forty seconds because it doesn't have to do API calls to the forge is a significant time savings.

When using auto, the default, the system now keeps track of the last time a server, group, or project was syned. It only syncs if the server or group hasn't been refreshed in a week or the project hasn't been refreshed in a day.

time fiss cache sync

real	0m3.126s
user	0m3.076s
sys	0m0.103s

That should make that aspect more useful.

Refresh On List

The third and final change was implementing syncing when running the list command. As said above, the only way to get new issues from the web was to run fiss cache sync. Now, fiss cache list also refreshes but it is more intelligent about it based on the scope.

For example, if only a project is requested, then it only syncs that project which takes considerably less time to implement (1-2 API calls at this point and usually under 100 ms with our current setup). However, if a group is requested, then it will only sync all the projects under that group.

fiss list --group fedran-sources
 id                                                title                                               state  assigned
 mfgames/fedran-sources/allegro/7                  Get automatic versioning working                    open
 mfgames/fedran-sources/allegro/6                  Get it sent to the copywriter                       open
 mfgames/fedran-sources/allegro/5                  Get it sent to the development editor               open
 mfgames/fedran-sources/allegro/4                  Create a cover a cover                              open
 mfgames/fedran-sources/coins-for-your-troubles/1  Chapters 12 and 13 need an editing pass             open
 mfgames/fedran-sources/flight-of-the-scions/2     Go through and update the various content warnings  open
 mfgames/fedran-sources/flight-of-the-scions/1     Make the book public                                open

And if fiss cache list --server mfgames is used, then it will sync all the groups and projects on that server before showing the list. Since this is automatic done (baring the use of --forge-sync), then fiss list will always get the most recent copy of the tasks that need to be done.

As, if the command is used without options, it picks up the project from the current Git repository which means fiss list is useful when inside that project's directory.

$ cd fiss
$ time fiss list
 id                    title                                                                       state  assigned
 mfgames/fiss/fiss/16  Get flake working as input for another flake                                open
 mfgames/fiss/fiss/15  Do not show archived projects by default                                    open
 mfgames/fiss/fiss/13  Implement subscriptions                                                     open
 mfgames/fiss/fiss/11  Allow for --body/-b to edit the body text                                   open
 mfgames/fiss/fiss/10  Show information after creating a new issue                                 open
 mfgames/fiss/fiss/8   Show progress while syncing with server                                     open
 mfgames/fiss/fiss/7   Refresh servers, groups, and projects periodically                          open
 mfgames/fiss/fiss/6   Cache foregejo API handle                                                   open
 mfgames/fiss/fiss/20  Handle fiss list fetching from empty set                                    open
 mfgames/fiss/fiss/21  Better handling when a server is removed from the config                    open
 mfgames/fiss/fiss/22  Allow output of URL or ID when creating a new issue                         open
 mfgames/fiss/fiss/23  Configuration option for how frequently to get server, groups, or projects  open
 mfgames/fiss/fiss/24  Allow sync from list to retrieve new groups and projects found              open
 mfgames/fiss/fiss/25  Change sync to be based on *_cache instead of by name                       open
 mfgames/fiss/fiss/26  Implement issue-level syncing                                               open
 mfgames/fiss/fiss/27  Figure out why Radicle will not sync                                        open

real	0m0.036s
user	0m0.030s
sys	0m0.009s

Future

We still use this project almost every day to manage our lists, but since we're the only people appearing to use it, features will show up as we need them or something annoys us. As usual, reporting issues is already appreciated but since we have to periodically disable registration on our forge, we'll be looking into better ways of submitting issues, having discussions, or getting patches. Until then, use Dylan's contact page or contact@mfgames.com.

Metadata

Project

Categories: