Feature Implement warnings when using SVN with github projects

Irrat

Member
By now everyone should be aware that Github is removing SVN support, and most github scripts should already be encouraging use of git over svn.


However, some people will be lazy and some will still get caught by surprise.

I think mafia should include a warning for every svn project when using an svn command that contains github.com.

Additionally, there could perhaps be a migration command/feature. Even if its just a `svn-to-git` command.

I've updated all my svn repos to git with the small script

Code:
js const svn = svnList().map(s => [s, svnInfo(s).url]).filter(([,url]) => url.includes("github.com/"));

svn.forEach(([project, url]) => {
const match = url.match(/^(https:\/\/github.com\/[^/]*\/[^/]*)\/branches\/([^/]*)$/);
  
if (match == null) {
print("Can't handle " + project + ", please resolve manually..", "red");
return;
    }
  
const checkout = "git checkout " + match[1] + " " + match[2];
cliExecute("svn delete " + project);
cliExecute(checkout);
});

However this also may have its own problems with sub-dependencies.

Regardless, mafia should probably implement a warning at the least.
 

Irrat

Member
Hmm, just realized that the "Script Manager" looks to be looking at SVN scripts only, it could probably do with a tune-up of its own tbh. Though that'd be a separate thread.
Thoughts on a tuneup being
1. Listing what versioning system it uses
2. Allow scripts installed outside of mafia's provided scripts, to provide their own name, authors, description and category
3. Perhaps a search filter, for both managing and installing
4. Displaying if a script is installed from a third party source, or from mafia
5. Displaying if a script is a dependency of another script
 

Ryo_Sangnoir

Developer
Staff member
Probably too early for this. There are a decent number of widely used scripts that either don't support git installation, or have a dependencies.txt that forces SVN installation for some dependencies.

I don't really want to display a warning to the user (daily, because "svn update" is a svn command that will run on github repos) that they can't do anything about.
 

fronobulax

Developer
Staff member
Fundamentally this is the script author's problem in the sense that mafia just honored what the script author told mafia.

In a more robust world the author would publish the location of a script and then the decision of how to access it via KoLmafia would be determined by KoLmafia with the "native" client for the repository being the first choice. But we are not there yet and there's a lot of thought that could go into this before anything is implemented.

Script Manager etc. could also be reworked if that is the biggest pain point for someone who wants to socialize a redesign and submit PRs that implement it.

If there is a Third Party Script that is not included in Script Manager then it is almost certainly because the author wanted it that way. I don't see much personal benefit to some kind of discovery process so that KoLmafia can partially manage third party scripts but then I am comfortable using KoLmafia commands to manage scripts and even SVN and Git clients at the operating system level. But maybe allowing local additions to svnrepo.json or its successors would be a worthwhile project.

If you want something to think about in an improved Script Manager consider abandoned or forked scripts. For example, I have used a snapshot script that is now on it's third maintainer. Wouldn't be nice if KoLmafia told me that and not me finding out from a forum post? I just want the latest snapshot functionality. Maybe KoLmafia could make me an alias 'snapshot" and handle whether it pointed to cc_snapshot or av_snapshot?
 

fronobulax

Developer
Staff member
I had forgotten that I already had a gCLI command that traversed the svn directory looking for file name conflicts. I tweaked it in https://github.com/kolmafia/kolmafia/pull/1580 to also check for SVN updates from GitHub.

Output on my system is

Found 161 repo files.
NewYou.ash uses SVN to update from GitHub
choice.ash uses SVN to update from GitHub
choice.example.ash uses SVN to update from GitHub
CombBeach.ash uses SVN to update from GitHub
FantasyRealm.ash uses SVN to update from GitHub
gain.ash uses SVN to update from GitHub
PirateRealm.ash uses SVN to update from GitHub
VotingBooth.ash uses SVN to update from GitHub
excavator.ash uses SVN to update from GitHub
x_autumnaton.ash uses SVN to update from GitHub
x_beach_comb.ash uses SVN to update from GitHub
x_beat_me.ash does not seem to have a valid remote repository.
x_bird_a_day.ash uses SVN to update from GitHub
x_coat_of_paint.ash uses SVN to update from GitHub
x_genie.ash uses SVN to update from GitHub
x_hookah.ash uses SVN to update from GitHub
x_juice_bar.ash uses SVN to update from GitHub
x_monster_parts.ash uses SVN to update from GitHub
x_mumming_trunk.ash uses SVN to update from GitHub
x_out_of_order.ash uses SVN to update from GitHub
x_pvp_effects.ash uses SVN to update from GitHub
x_utils.ash uses SVN to update from GitHub
mskc_mp_monsters.txt uses SVN to update from GitHub
mp.css uses SVN to update from GitHub
mp.css.map uses SVN to update from GitHub
tipr.css uses SVN to update from GitHub
mp.js uses SVN to update from GitHub
tipr.min.js uses SVN to update from GitHub
mp.scss uses SVN to update from GitHub
_normalize.scss uses SVN to update from GitHub
mp_main.ash uses SVN to update from GitHub
relay_Manuel_Progress.ash uses SVN to update from GitHub
choice.1420.ash uses SVN to update from GitHub
icon.png uses SVN to update from GitHub
bundle.1f010.js uses SVN to update from GitHub
bundle.1f010.js.map uses SVN to update from GitHub
bundle.88c52.css uses SVN to update from GitHub
bundle.c8e54.esm.js uses SVN to update from GitHub
bundle.c8e54.esm.js.map uses SVN to update from GitHub
index.html uses SVN to update from GitHub
manifest.json uses SVN to update from GitHub
polyfills.078e9.js uses SVN to update from GitHub
polyfills.078e9.js.map uses SVN to update from GitHub
polyfills.88be1.esm.js uses SVN to update from GitHub
polyfills.88be1.esm.js.map uses SVN to update from GitHub
preact_prerender_data.json uses SVN to update from GitHub
push-manifest.json uses SVN to update from GitHub
shorts-ui.ash uses SVN to update from GitHub
ssr-bundle.88c52.css uses SVN to update from GitHub
ssr-bundle.88c52.css.map uses SVN to update from GitHub
ssr-bundle.js uses SVN to update from GitHub
ssr-bundle.js.map uses SVN to update from GitHub
sw-debug.js uses SVN to update from GitHub
sw-esm.js uses SVN to update from GitHub
sw-esm.js.map uses SVN to update from GitHub
sw.js uses SVN to update from GitHub
sw.js.map uses SVN to update from GitHub
Local SVN repos scanned for possible duplicates and GitHub host.

Presumable something will have to happen before January 8, 2024 but I have not narrowed down the possibilities yet.
 

fronobulax

Developer
Staff member
Improved version at https://github.com/kolmafia/kolmafia/pull/1582

Sample output
Local installation of coandco-mafia-NewYou-trunk uses SVN to update from GitHub.
Local installation of Ezandora-Choice-Override-branches-Release uses SVN to update from GitHub.
Local installation of Ezandora-Comb-Beach-trunk-Release uses SVN to update from GitHub.
Local installation of Ezandora-FantasyRealm-branches-Release uses SVN to update from GitHub.
Local installation of Ezandora-Gain-branches-Release uses SVN to update from GitHub.
Local installation of Ezandora-PirateRealm-trunk-Release uses SVN to update from GitHub.
Local installation of Ezandora-Voting-Booth-trunk-Release uses SVN to update from GitHub.
Local installation of gausie-excavator-trunk-RELEASE uses SVN to update from GitHub.
Local installation of matt-chugg-manuel_progress.git-trunk uses SVN to update from GitHub.
Local installation of phulin-shorts-ui-branches-master-build uses SVN to update from GitHub.
Local SVN repos scanned for possible GitHub access via SVN.
 
Top