New Content Patching KoLmafia for non devs

fronobulax

Developer
Staff member
A request was made to create and maintain a sticky thread explaining the patch process for non-devs.

The process is actually quite simple.

  • Write and test a patch.
  • Post the patch file on kolmafia.us.
  • Wait for a dev to submit the patch for you.

A successful submit requires social and technical skills.

The set of social skills includes the ability to get along with devs at the KoLmafia.us community. Users that have managed to alienate themselves from members of the dev team tend to have their proposed patches ignored.

The ability to determine the appropriateness of a patch and the level of support for it is extremely useful. A patch that violates the spirit of KoLmafia (for example, that allows access to non-KoLmafia directories in the user's file system) will be rejected. A patch that changes an existing feature would need some discussion. A patch that changes a lot of code to implement a feature of at best niche interest is unlikely to be accepted.

The technical skills are the ability to write and test Java code that works in the context of KoLmafia. A prerequisite for success is the ability to read and understand KoLmafia's code and infer its archetecture since those are not well documented in the traditional sense.

Some existing links that may bear on this are:


Note that the contents of some of these links may be out of date but perhaps an effort to use them will result in updates :)

Individuals with a good track record of creating and submitting patches can ask to be made a dev. The active devs who can do this are veracity0 and lostcalpolydude.

This post is a beginning in hopes that it will attract useful information and eventually become one stop documentation.

To the extent that opinions are expressed, they are all my personal opinions and I reserve the right to change them if someone thinks I am wrong :)
 

fredg1

Member
Is Eclipse mandatory to debug your own code without compiling? I kept getting an error about not having "org.eclipse.ui.ide.multiFilter" (using VScode)

P.s., some of the paths in .classpath were pointing to old version of the files I had (like lib/jar/trilead-ssh2-1.0.0-build219.jar instead of lib/jar/trilead-ssh2-1.0.0-build222.jar). Is it a file that doesn't get updated when running TortoiseSVN, or is .classpath something you need to correct locally?
 
Last edited:

fronobulax

Developer
Staff member
Eclipse is a preference, not a requirement. I have never used it seriously. I used NetBeans until I had a job where the commercial version of IntelliJ was the standard and I switched to the free version for KoLmafia.

.classpath is one of the managed svn files. I believe it is irrelevant unless your IDE is Eclipse. AFAIK nothing in my environment is paying attention to it.

I'm not sure what to make of your error other than observe that it seems as if your environment is not configured properly. I can imagine an import process where VSCode thought it was importing a complete Eclipse project. Checking in IDE specific files isn't always the best thing to do if the dev team isn't striving for a homogeneous environment across the team. I would investigate import settings and see if you can tell VSCode to create a new "project" from the mafia source instead of trying to import a project.
 

Crowther

Active member
Nice start fronobulax. I especially like that you documented the social skills required. Submitting a patch is much like submitting a bug report and people often fail to say to include all the right details. One thing I think you missed is coding style. Patches that don't match KoLmafia's existing coding style are nearly always rejected.
 

fronobulax

Developer
Staff member
Nice start fronobulax. I especially like that you documented the social skills required. Submitting a patch is much like submitting a bug report and people often fail to say to include all the right details. One thing I think you missed is coding style. Patches that don't match KoLmafia's existing coding style are nearly always rejected.

Thank you. I avoided coding style because first and foremost I get it wrong myself when going from memory and haven't looked it up again. Since patches will be reviewed I personally don't mind correcting style issues that I notice and getting chided for the ones I miss. But I should write that up.

The social skills I think are key.
 

Crowther

Active member
Thank you. I avoided coding style because first and foremost I get it wrong myself when going from memory and haven't looked it up again.
I always just copy whatever style is already in the file I'm editing. At this point in my life it is just a reflex. You are right different devs have different preferences.
 

Veracity

Developer
Staff member
Is Eclipse mandatory to debug your own code without compiling?
I don't know. I don't use an IDE to debug KoLmafia code. I do have Eclipse and IntelliJ installed (the latter because I used it in my last job, before I retired, about 6 months ago, I still have not done everything needed to make it work like I'd like to, since,as I said, my personal debugging style for this project has never required an IDE.)

I do know that I have always had to update some classpaths - like the current SDE I am using - no matter which IDE I use. I needed that at my final job, too, whenever I updated the SDE on my system.

I can't speak to TortoiseSVN. I use the "svn" command from my commandline - and the "java" command from my command line - to maintain my project and execute .jar files.

If we check in a new version of the library, one would hope that it would appear and be used in your IDE's workspace. I am inclined to blame your IDE, rather than TortoiseSVN (which I do not use, since that is a Windows thing), for failing to use things which are, literally, sitting in your workspace.

The "build.xml" ant file is the Source of Truth regarding what is needed to build KoLmafia. Eclipse and IntelliJ Idea are able to do that. Perhaps VScode is not?
 

Veracity

Developer
Staff member
I always just copy whatever style is already in the file I'm editing. At this point in my life it is just a reflex. You are right different devs have different preferences.
I do this too.

My personal style is not like KoLmafia's (I like to cuddle blocks inside a function, for example) and do not like the style that is enforced at other places I have worked (I hate cuddling the block on a function definition, and not putting whitespace in function calls makes it vastly harder to read, for example.)

But, there is a "style" for KoLmafia, and I always write to it here - and will "correct" non-compliant code when I have cause to edit it.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
This is no longer how we do patching KoLmafia, so I'm going to unsticky this for now until we have something better in place.
 

fronobulax

Developer
Staff member
This is no longer how we do patching KoLmafia, so I'm going to unsticky this for now until we have something better in place.

In the meantime the short answer is
If this doesn't make sense you may remind me that I am still not getting the vocabulary quite right or you may want to become more familiar with using git. Your patch will have to pass some automated tests and be reviewed and approved by one or more KoLmafia Staff, aka "devs".
 

heeheehee

Developer
Staff member
In the meantime the short answer is
This is mostly correct, except most people do not have write access to kolmafia/kolmafia. Instead, you can fork the repository, write your patch as a branch of that repository (e.g. heeheehee-kolmafia/kolmafia:maximizer), and then create a pull request for that branch.

It should work identically, and I've been using it somewhat interchangeably with mainline feature branches (with small amounts of thought going into the decision of "do we want this in the main repo or not").
 
Top