Pages: 1 2 3 »
  Print  
Author Topic: Proposal for guidelines on changes to the master branch of enigma-dev/enigma-dev  (Read 7050 times)
Offline (Unknown gender) forthevin
Posted on: June 04, 2013, 11:34:10 AM

Contributor
Joined: Jun 2012
Posts: 171

View Profile
Due to various issues in regards to changes to the master branch of enigma-dev/enigma-dev, I believe it would be useful to have some guidelines on how changes to the master branch should be handled.

The following guidelines are not complete, but should be a good starting point. If the guidelines at some point are accepted, I will post them on the wiki.

Guidelines for changes to the master branch.

The idea behind these guidelines is to help developers and contributors, old as new, making good decisions in regards to the master branch of the repository. It is based off common thought and experience between the developers, and is not meant to be fast and hard rules, but informing and guiding developers. It should be noted that "developers" and "contributors" are used interchangeably in these guidelines.

Change notes:

2013-06-06: Added information on how to use git and GitHub to handle changes.
2013-06-04: Creation of this document.

Purpose of these guidelines:

  • Create common perspective amongst developers on the purpose of the master branch and how to deal with changes to it.
  • Help make developers aware of some of the possible issues that changes can create.
  • Inform and guide developers in regards to how to deal with changes.

The purpose of the master branch of enigma-dev/enigma-dev:

The master branch is the generally used branch by both developers and users. Having a common branch enables quick fixing and development, and means users will not have to wait long before getting the newest additions or fixes. Given that ENIGMA is still not fully mature or feature complete, it makes sense to have a semi-stable main branch, which will rarely break games relying on core and established functionality, while still allowing quick development and experimentation on unstable and non-core parts. However, if the master branch breaks core or established functionality all the time, the master branch becomes very unstable for users, and developers will waste time on finding and fixing issues that used to be non-issues. For this reason, it is important to keep the master branch at least semi-stable, rarely breaking core or established functionality.

Possible issues with changes:

  • Buggy changes that cause regressions, either silently or loudly, resulting in runtime crashes, very poor performance, compile-time errors, etc. These are the most common types of issues, and can often be prevented by testing it with the relevant configurations.
  • Changes that handles an issue in one subsystem, but does not handle the same issue in other subsystems of its kind. These changes can be bothersome, because it may cause confusion about whether an issue has really been handled, and it takes time to determine where the issue is handled. Frequently, a lot of time can be saved later by ensuring that the issue is handled in all relevant subsystems, or at least creating an issue on the tracker that describes where the issue has been handled and not handled.
  • Changes that depends on specific tools and technologies, which can take considerable amounts of work to fix, especially if time pass and more and more of the code depends on it. Some of these changes are necessary and acceptable, for instance when making platform-specific changes in an isolated platform subsystem. Main ways to avoid or handle such issues is to follow standards when available, isolate technology dependencies in specific systems (OpenGL{1,3}, DirectX, OpenAL, SFML Audio, etc.) and using them through generic interfaces, and simply coding things in a way that is fully or mostly independent of the technology or tool used (using common subset of available features amongst main Make build tools). Another way is also to put off using bleeding edge features until support is mature and widely available.
  • Architecture and interface changes affect how the different systems interact. Bad interfaces decreases modularity and increases coupling and dependencies amongst systems, and generally make it more difficult to debug, test and develop systems. It can be difficult to determine or predict whether an interface will be good or bad, so thinking about and discussing important systems, as well as developing for change, is generally advisable. Isolating dependent code between systems in "bridges" is one way to decrease coupling in certain cases.

Dealing with changes:

When you are in doubt about a change, and whether it should be committed to the master branch, there are several options for dealing with that:

  • The first is to test the change out for relevant scenarios. This is often quite effective, and it is therefore recommended that you always do at least light testing of your change, but you should take care to test with all the relevant configurations. For instance, if you change the interface for a subsystem like Collisions, it is a good idea to test that each collision subsystem still compiles and works with the new interface. That said, testing does not cover everything, and it can sometimes be difficult to test things, but testing for simple compilation and running is generally useful and easy. The main exception is testing of different platforms; in these cases, it is a very good idea to get others to test the changes.
  • Taking time to look at the changes, investigating them, looking through them, etc., can be laborious but quite effective. It can also help to improve the changes themselves. This should be always be done to some degree when working on established and core features, to avoid easily avoidable issues.
  • Experiment! Make the change in a fork or a branch other than master, and experiment and work with it. If the system is not yet established and known to people not to be ready for use yet, you can also do experimentation directly in master. Just be careful not to do experimentation outside of the specific system.
  • Implement the change in a fork or branch, and get others to look at it. This takes the time of others, but may well save time down the road. This is very appropriate for changes that could cause considerable issues if faulty, especially if you have already tested, experimented and/or investigated the changes thoroughly.
  • Low-severity changes are much less risky to commit than high-severity changes.

When determining whether a change should be committed to the main branch, it is useful to determine what issues it has. However, it can be difficult to determine all the issues of a given change. To handle this, there are some general guidelines for estimating the potential severity of possible issues of a change.

  • If a change is fully isolated to a subsystem, getting the change wrong will only affect that subsystem and other systems that depend on that subsystem (directly or indirectly). The more systems that depend upon a given subsystem, the more things it can break.
  • Systems and features that are used by most users and developers directly or indirectly, such as most of the stuff in Universal_System, the graphics system OpenGL1, or the Precise collision system, will affect many. Conversely, systems that are only occasionally used (like the audio system, the None collision system, the datetime extension, or the particles extension), and which aren't depended upon by any other systems, will not affect nearly as many. As long as they still compile or are not by default on, breaking them does is not as severe. That said, breaking such system and letting them stay broken can cause problems down the line, and since they are used less, issues will generally be found and reported relatively later.
  • Unstable parts that aren't used and aren't meant to be used, will not affect users or developers other than the ones working on it.
  • Issues that prevent compilation or running games with ENIGMA at all are quite severe. It is generally easy to test for these issues, since if it compiles and runs, then it shouldn't be a problem. The main issue is if the changes has platform-specific parts. Testing for several different platforms can be bothersome or impossible, depending on hardware. Use a fork or a branch to share and have an easier time with testing or in order to get others to test on the platforms you do not have access to that it really does not break things.
  • Platform-specific issues can be bothersome to find, debug and fix. Therefore, a platform-specific issue is generally more severe than a non-platform-specific change when all else is equal.
  • Changes that deal with interfaces and architecture can have long-term issues, and they can be difficult to test. Thinking about them and discussing them with others is generally recommended to help ensure that the changes are good, as well as seeking to make a flexible design that allows correcting some mistakes in the interface. A good thumb of rule is that the less dependencies and the less coupled the changes make the interface, the less that can go wrong.
  • If there are parts of the potential issues that you are not confident you know sufficiently about, determining the severity can be difficult. Learning more about those parts and related topics can be recommended, as well as asking others for advise on the topics as well as the changes in question.
  • One other factor to consider is the severity of the alternatives. If the change is definitely better than the current status, it may be better to commit and describe the uncertainties regarding the changes, such that they can be looked at later by yourself and others.

Using git to handle changes:

git offers several features which can be used to handle changes. One of these features are branches. See http://gitref.org/branching/ for information about what a branch is. In regards to changes, the master branch is the main branch used by users and developers alike. By creating and using a separate branch from the master branch, you can do any changes you want without it bothering anyone else, and let others look at it, possibly fix any issues, and then merge it into master.

For examples on how to use branches, see post 1 and post 2.

Using GitHub to handle changes:

Another feature is the fork of GitHub, which you can find more information about here: https://help.github.com/articles/fork-a-repo. Basically, a fork creates a whole new repository based on the new one, where you can do any changes you want, and once you would like others to look at it or get it merged into the main repository, you can make a pull request where you describe the changes and other relevant details. If more work is needed, you can make more commits, and it will be reflected in the pull request.
« Last Edit: June 06, 2013, 11:54:06 AM by forthevin » Logged
Offline (Male) polygone
Reply #1 Posted on: June 04, 2013, 11:44:23 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
I will add that I think it's a good idea for any developer to try and look and take note of all the commits that are made. This will reduce the need for fork testing as mistakes can be picked up in this way almost as efficiently and quickly. I do this a lot and find that knowing what commits were made and when comes in handy all the time in dealing with random things that crop up. So am I the only one that currently really does this?

And this whole blame game thing that people like to do with regards to the repo isn't healthy for progress at all. I consider the benefit of progress to massively outweigh the negatives of the odd mistake or regression that might occur. It's hardly like many people are yet using ENIGMA to develop games properly, the progress of the engine is by far the most important thing still at this point. In the future, if more people are developing with it then we will probably want to set-up a more stable repo base by using a common update branch which is properly tested before merging into main. But we're not near that point in the development yet in my opinion, it's more costly to halt the progress with branching and over testing by other developers.
« Last Edit: June 04, 2013, 11:54:04 AM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Unknown gender) forthevin
Reply #2 Posted on: June 04, 2013, 12:21:57 PM

Contributor
Joined: Jun 2012
Posts: 171

View Profile
I generally look at the commit messages, while I usually skim through the commits themselves. Properly looking through a big commit can take quite some time.

It is true that not many users are affected by regressions yet. However, I believe regressions can hinder development considerably as well, given that it takes time to replicate the bug, isolate and find it, figure it out, fix it, and test that the fix works. That said, I agree with you that we shouldn't be too careful with everything either, since that does take time as well

I personally think that automated regression testing will help these issues a lot. It will decrease the burden of testing considerably, and by making things more stable that way, will also lessen the amount of time spent on debugging. I personally plan to look into it in the future, after I have looked at some other issues such as the synchronization issue.
Logged
Offline (Male) polygone
Reply #3 Posted on: June 04, 2013, 12:38:10 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
I personally think that automated regression testing will help these issues a lot.
We could all use a standard test file when going to test if ENIGMA still compiles after changes so it could serve multi-purpose to concurrently report if any regression has occurred.
« Last Edit: June 04, 2013, 12:47:10 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Goombert
Reply #4 Posted on: June 04, 2013, 12:50:03 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Oh yes, I complete forgot to post about this, forthevin somebody gave me a great idea in the IRC. They told us to compile a series of "unit tests" so basically we make a mini demo that demonstrates that everything works, paths, graphics, physics, collision systems, kind of a lot like you see with the little demos I program. Make a broad series of them covering everything and use them for ensuring there are no regressions during mergals.

Now polygonz, your argument is good, but it just does not work for what you did with just breaking the mouse code. That is not progress, you could have just left it be the slow implementation on other platforms and then filed an issue on the tracker for one of the platforms maintainers to address. Just removing obsolete code is not progress, can you just imagine if Ubuntu or Linux distros or other open source software did this? My god, it's a disasterous idea, and you seriously need to stop thinking that way. Your mindset and the way you approach this is everything wrong with open source, and why every freaking Ubuntu update has to break something.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) polygone
Reply #5 Posted on: June 04, 2013, 01:01:51 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
1) I couldn't just leave it slow on other platforms, I was moving things around from universe to try and get the speed increase. It would have been more effort than it's worth for me to change everything around to make the functionality of the mouse position work.
2) It took literally 2 seconds to add that functionality back into the other systems
3) mouse_x/y is useless
4) I would have normally made an issue report and have done on other occasion with something like this, I just forgot on this instance. I made a note in the commit message at least and mentioned it on the IRC.
5) The big difference being here that lot's of people actually use Ubuntu. Whereas we're still trying to get the engine to a point where a proper user-base want to use it. Like I said only at that point should we properly care about things such as this
6) I'm not talking about this crap again :p
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Goombert
Reply #6 Posted on: June 04, 2013, 01:39:21 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
#1 and #2 are conradictions
#3 is completely obsurd, I'd say about %40 of games or even a lot more, I am lowballing it, require a mouse especially on flash games
#4 you should have probably directed it at josh and not me, because I generally do not care as long as nothing breaks, therefore I ignore about %90 of everything you guys say
#5 no, don't call it progress, you fuck up progress by forcing us to drop anything were doing and fix whatever it is you wan't us to fix
#6 then don't break shit, it is not that fucking hard
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) polygone
Reply #7 Posted on: June 05, 2013, 04:09:48 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
#6 then don't break shit, it is not that fucking hard
Do you know what the optimum strategy is for me to take in order to ensure not break anything? It's for me to not commit anything else. And that's precisely the angle that you guys like to push for when you complain about a largely irrelevant and minor regression like this.
« Last Edit: June 05, 2013, 04:18:44 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #8 Posted on: June 05, 2013, 04:39:52 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
When I said useless I meant trivial, and it's not going to break compiling. I expected the mouse update to be added back into the linux platform straight away.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #9 Posted on: June 05, 2013, 04:49:27 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
What does it matter that people temporarily couldn't use mouse_x/y for 5 minutes?
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Goombert
Reply #10 Posted on: June 05, 2013, 04:50:46 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Lol, it was a week polygonz, in fact I haven't pulled yet and it is still screwed up on my system.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) polygone
Reply #11 Posted on: June 05, 2013, 04:51:44 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
It wasn't a week that people were using it, it would have been reported. And as soon as it was reported anybody could have resolved it within 5 seconds. In any case nobody was releasing a game in that period of time, it was irrelevant.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Goombert
Reply #12 Posted on: June 05, 2013, 05:12:19 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Polygonz you are way too thick headed, if you see nothing wrong with your statement about people releasing games, then I am afraid there is nothing more to discuss. I do not understand what part of people need the mouse functionality locally in order to make a game or even test/program/develop and all of our source code check out systems including the Windows installer go for the latest revision. And it was a week I first had it when you were doing the stuff to speed up the fps rate and did not say anything until a week later when whats his face reported it to me, and I did not say anything to you because I assumed you were just commenting shit out temp. I did not know you were purposely breaking it indefinitely.
« Last Edit: June 05, 2013, 05:59:19 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) polygone
Reply #13 Posted on: June 05, 2013, 05:29:13 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
If somebody tried it, it would be clear to them straight away that the mouse positions were not being updated, then they simply say so and it's fixed straight away. And this is exactly what happened, if it took a week for it to get mentioned then it suggests that they're not in as much use as you probably though. No harm was done by this at all, nobody's progress was delayed. And now thanks to my changes ENIGMA runs faster and with a commit back that took 2 seconds to do the mouse update is back to normal.

You're the one that's thicker header.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Goombert
Reply #14 Posted on: June 05, 2013, 05:38:48 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Of course polygonz, you are right all of our bugs are fixed STRAIGHT AWAY amirite? Thats why we have sooo fuckin many unaddressed tickets on the tracker, isn't it? And no I am not thick headed I listen when Josh and Ism explain this stuff about how to properly be commiting and ensuring there are no regressions etc.
« Last Edit: June 05, 2013, 05:59:39 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1 2 3 »
  Print