{"thread":{"id":"8224","subject":"sbuild (or whatever) integration","startedAt":"2007-05-19T13:17:04Z","lastAt":"2007-05-29T17:15:30Z","messageCount":4,"participants":["Florian Weimer","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"42624","messageId":"87sl9t6jhr.fsf@mid.deneb.enyo.de","threadId":"8224","inReplyTo":null,"subject":"sbuild (or whatever) integration","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2007-05-19T13:17:04Z","receivedAt":"2007-05-19T13:17:04Z","isPatch":false,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"I'd like to build something that integrates a Debian autobuilder\n(sbuilder probably) with GIT.  The intent is to get rid of a\ndesignated integrator (our team is of a size where this seems a\nreasonable thing to do[1]) and ensure predictable builds, independent\nof what developers happen to have installed on their local\nworkstations.\n\nBasically, what I want to do is this:\n\n  1. Perform a checkout from a specific branch.\n\n  2. Synthesize a new version number that is bigger than the previous\n     one.  (This needs to keep a bit of extra-repository state.  At\n     this stage, it's probably a good idea to ensure that the previous\n     commit built on this branch is an ancestor of the current HEAD.)\n\n  3. Generate a fake Debian changelog entry giving the HEAD commit and\n     the branch name, using the generated version number.\n\n  4. Build the whole thing in a controlled environment.\n\n  5. Store the build log for later review.\n\n  6. If the build was successful, transfer the packages to some\n     repository (based on the branch that was used).\n\nThe GIT repository in step one is a shared one, with an update hook\nthat that ensures fast-forward merges, as in:\n\n<http://www.kernel.org/pub/software/scm/git/docs/howto/update-hook-example.txt>\n\nThe idea is that this means that features are monotonic along a\nbranch.  Ideally, I would like to have something which can assign\nmeaningful version numbers across two branches, but this is of course\nimpossible to automatically.  I hope to work with a single release\nbranch anyway, and use at most two (one for testing, one for\nproduction).\n\nDoes this sound reasonable?  Has anybody built something similar?\n\n[1] This is for internal development, and due to various constraints,\n    we haven't got developer-specific integration testing\n    environments.  That's why we need to linearize before actual\n    deployment.\n"},{"id":"42910","messageId":"20070521181505.GA5082@efreet.light.src","threadId":"8224","inReplyTo":"87sl9t6jhr.fsf@mid.deneb.enyo.de","subject":"Re: sbuild (or whatever) integration","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-05-21T18:15:05Z","receivedAt":"2007-05-21T18:15:05Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Sat, May 19, 2007 at 15:17:04 +0200, Florian Weimer wrote:\n> I'd like to build something that integrates a Debian autobuilder\n> (sbuilder probably) with GIT.  The intent is to get rid of a\n> designated integrator (our team is of a size where this seems a\n> reasonable thing to do[1]) and ensure predictable builds, independent\n> of what developers happen to have installed on their local\n> workstations.\n\nThat's definitely a useful and reasonable thing to do.\n\n> Basically, what I want to do is this:\n> \n>   1. Perform a checkout from a specific branch.\n> \n>   2. Synthesize a new version number that is bigger than the previous\n>      one.  (This needs to keep a bit of extra-repository state.  At\n>      this stage, it's probably a good idea to ensure that the previous\n>      commit built on this branch is an ancestor of the current HEAD.)\n> \n>   3. Generate a fake Debian changelog entry giving the HEAD commit and\n>      the branch name, using the generated version number.\n> \n>   4. Build the whole thing in a controlled environment.\n> \n>   5. Store the build log for later review.\n> \n>   6. If the build was successful, transfer the packages to some\n>      repository (based on the branch that was used).\n\nI don't think there is actually too much code that would be common for\nvarious git users. It has some code common for Debian developers, either\nusing Git or even other version control:\n\n1. This is one or at most few commands in a script or makefile, so not much\n   room for generic stuff there.\n2. This is something big conitnuous integration suites have complex system to\n   solve, just to hide the fact that it's worth few lines of perl. However:\n    - You might want to make up something Debian specific. Something like\n      looking at latest entry in debian/changelog (that would be the last\n      release) and adding an extra number to that.\n    - Alternatively you could use git describe to get the version number of\n      last release. Since it's fast-forward only, next build is always from\n      descendant of previous, so you might even use git-describe output\n      directly.\n3. This is mostly Debian-specific. If you remember commit id of previous\n   build -- or leave the entries in debian/changelog around -- you can put\n   the short log in the entry, but that's single git command once you have\n   the respective version ids.\n4. These are Debian-specific commands, but would be the same for every Debian\n   package.\n5. This is mainly issue of sbuild setup, no?\n6. Again, sbuild -- and therefore Debian -- specific (but reusable in\n   Debian).\n\nIMHO generic tools won't help you much, because every other command is Debian\nspecific.\n\nWhat *CAN* help you is the script in\n    /usr/share/doc/git-core/contrib/continuous\nthat will make sure the package is built whenever there are some new changes\non the branch while not doing unnecessary work.\n\nThere are actually even big projects with web interface and stuff to do this\nkind of thing, but they don't actually cover your steps above except 1 and 2.\n1 is trivial and for 2 you have to tell it how to create those numbers\nanyway, so it won't buy you much. IMHO the git contrib/continuous scripts can\ndo the same for you with much less overhead.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"43551","messageId":"87ps4kasku.fsf@mid.deneb.enyo.de","threadId":"8224","inReplyTo":"20070521181505.GA5082@efreet.light.src","subject":"Re: sbuild (or whatever) integration","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2007-05-29T09:26:41Z","receivedAt":"2007-05-29T09:26:41Z","isPatch":false,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"* Jan Hudec:\n\n> IMHO generic tools won't help you much, because every other command is Debian\n> specific.\n\nYeah, and I mainly wanted to reuse process, not code.  Thanks for your\ncomments.\n"},{"id":"43578","messageId":"20070529171530.GB2980@efreet.light.src","threadId":"8224","inReplyTo":"87ps4kasku.fsf@mid.deneb.enyo.de","subject":"Re: sbuild (or whatever) integration","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-05-29T17:15:30Z","receivedAt":"2007-05-29T17:15:30Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Tue, May 29, 2007 at 11:26:41 +0200, Florian Weimer wrote:\n> * Jan Hudec:\n> \n> > IMHO generic tools won't help you much, because every other command is Debian\n> > specific.\n> \n> Yeah, and I mainly wanted to reuse process, not code.  Thanks for your\n> comments.\n\nThe process is definitely sensible. Also I mentioned the git\ncontrib/continuous scripts to help you schedule the builds.\n\nRegards,\n\nJan\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}