Diff for "QAProcessContinuousRollouts"

Not logged in - Log In / Register

Differences between revisions 1 and 14 (spanning 13 versions)
Revision 1 as of 2010-07-16 10:46:27
Size: 4738
Editor: ursinha
Comment: First version
Revision 14 as of 2010-11-08 10:39:06
Size: 9522
Editor: henninge
Comment: MergeWorkflow is not proposed anymore - it's reality.
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= QA in the Continuous Rollouts Process = <<TableOfContents>>
Line 3: Line 3:
The proposed merge workflow is in https://dev.launchpad.net/MergeWorkflowDraft. This merge workflow assumes that QA is the blocker of a branch to be rolled out to production, so we need to do the bookkeeping to provide the QA information. = Continuous Rollouts Process: the QA side =
Line 5: Line 5:
The MergeWorkflow relies on QA, enough to assume a branch able (or not) to be rolled out to production based on its QA state.
Line 6: Line 7:
== First, a definition == We need to do the bookkeeping to provide the QA information to the mechanism that will do the rollouts. Details on how we intent to do this are described in this wiki page.
Line 8: Line 9:
A bug is the smallest unit of QA. So, deciding if something needs QA is based on the existence of the bug. But, it's not required to have a bug for each branch. Inform that a branch is [no-qa] when it's the case, and the revision is QA-covered. == Definition of QA ==
Line 10: Line 11:
A bug is the smallest unit of QA. So, deciding if something needs QA is based on the existence of the bug. But, it's NOT required to have a bug for each branch. Informing that a branch is unQAable when landing it will QA-cover it.
Line 11: Line 13:
== Branches from a QA perspective == A fix is considered QAed when falling into one of the following categories:

=== States of QA ===

 * qa-ok: The branch is verified and implements successfully what it proposes.
 * qa-untestable: The branch cannot be tested separately of the rest of the fix or cannot be tested at all, and is harmless.
 * qa-bad: The branch is verified and doesn't work as it should or causes regressions. This is derived by having a bad-commit with no rollback=XXX for it in devel. bad-commit tags are of the form bad-commit-REVNOINDEVEL.
 * qa-needstesting: The branch has landed and is waiting to be QAed.

qa-untestable, and qa-needstesting should be set by the [[http://launchpad.net/qa-tagger|tagger]]. qa-bad and qa-ok should be manually set by the developer. The diagram at the end of this page shows the QA states of the bug and the changes that trigger them.

== Connecting branches and QA ==
Line 15: Line 28:
== Marking branches appropriately when landing them == == How to make branches QA-aware when landing them ==
Line 17: Line 30:
To represent and sign those situations, there are three new commit message tags: [no-qa], [incr] and [rollback]. Note that the idea is to gather as much as possible information in the merge proposal, so you only have to pass parameters to ec2 land and bzr lp-land instead of handcrafting the commit message for it to be in a QA-consistent state. To represent and sign those situations, there are three new commit message tags: [no-qa], [incr] and [rollback=xxx]. Note that the idea is to gather as much information as possible in the merge proposal, so the developer only has to use parameters on {{{ec2 land}}} and {{{bzr lp-land}}} instead of handcrafting the commit message for it to be recognized as in a QA-consistent state.
Line 19: Line 32:
Each category below describes what you need to do to make the assertion. It also tells you what automation it will trigger. To get your branch landed, you must assert that your branch falls in one of the following categories: The developer should set the commit message in the merge proposal, without worrying about the QA clauses (incremental, bug, no-qa and rollback), and the helper scripts should generate the correct PQM commit message.

Each category below describes what the developer needs to do to make the assertion. It also tells the developer what automation it will trigger. For simplicity we're using {{{ec2 land}}} in all the examples.

{{{ec2 land}}} will check in the merge proposal for all bugs that aren't Fix Committed or Fix Released, and then add their numbers to the [bug=] clause in the commit message to be sent to PQM. If no bugs within these rules are found, and the branch isn't explicitly told as [no-qa], the command should fail. In such cases you should or file a new bug, linking it to the branch, or set the proper existing bug's status to In Progress.
Line 22: Line 39:
 1. We can QA it, and it fixes one or more bugs. In order to get the branch landed, the developer must assert that the branch falls in one of the following categories:
Line 24: Line 41:
  * What you do: Link the bug to the branch in Launchpad.
  * What the tagger does: Each related bug is marked Fix Committed and tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in.
=== We can QA the branch, and it fixes one or more bugs (most common) ===
Line 27: Line 43:
 2. We can QA it, and it is an incremental step towards one or more bugs.   * '''Developer action''': Link the bug to the branch in Launchpad (see alternative below), and use {{{ec2 land}}} or {{{bzr lp-land}}}:
{{{
      $ ./ec2 land https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Each related bug is marked Fix Committed and tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in.
Line 29: Line 49:
  * What you do: Link the bug to the branch in Launchpad, and pass {{{--incr}}} or {{{--incremental}}} to {{{ec2 land}}} or {{{bzr lp-land}}}.
  * What the tagger does: Each related bug is tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.
||<tablestyle="width: 80%;" colspan=3 style="background: #FFB114; font-weight: bold; color:#330000">TIP||<style="background: #ffff7a;">'''Alternative way to link bugs to branches in Launchpad, automatically:''' Instead of accessing the branch page in Launchpad and linking the bugs manually after pushing it, the developer can use {{{bzr commit --fixes=123456}}}. It adds the information of the bug fixed in the branch metadata. When the same branch is pushed to Launchpad, it's scanned and provided fixed bugs are automatically linked to the branch in Launchpad. ||
Line 32: Line 51:
 3. We cannot QA it, and it is an incremental step towards one or more bugs. === We can QA the branch, and it is an incremental step towards the fix of one or more bugs ===
Line 34: Line 53:
  * What you do: Link the bug to the branch in Launchpad, and pass {{{--incr}}} or {{{--incremental}}} and {{{--no-qa}}} to {{{ec2 land}}} or {{{bzr lp-land}}}.
  * What the tagger does: Each related bug is tagged qa-untestable, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.
  * '''Developer action''': Link the bug to the branch in Launchpad (see alternative above), and use {{{--incremental}}} on {{{ec2 land}}} or {{{bzr lp-land}}}.
{{{
      $ ./ec2 land --incremental https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Each related bug is tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.
Line 37: Line 59:
 '''NOTE: don't say that the last branch in an incremental chain is [incr]. Just submit it like category 1.''' === We cannot QA the branch, and it is an incremental step towards the fix of one or more bugs ===
Line 39: Line 61:
 4. We cannot QA it, but it fixes one or more bugs.   * '''Developer action''': Link the bug to the branch in Launchpad (see alternative above), and use {{{--incremental}}} and {{{--no-qa}}} on {{{ec2 land}}} or {{{bzr lp-land}}}.
{{{
      $ ./ec2 land --incremental --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Each related bug is tagged qa-untestable, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.
Line 41: Line 67:
  * What you do: Link the bug and the branch in Launchpad, and pass {{{--no-qa}}} to {{{ec2 land}}} or {{{bzr lp-land}}}.
  * What the tagger does: Each related bug is marked Fix Committed and tagged qa-untestable.

 5. We cannot QA it, and it does not have an associated bug.

  * What you do: Pass {{{--no-qa}}} to {{{ec2 land}}} or {{{bzr lp-land}}}.
  * What the tagger does: Nothing. We include it in a QA report for the current cycle (just a wiki page for now).

 6. We cannot QA it, and it's just a rollback of a previous bad or unQAed branch.

  * What you do: Pass {{{--rollback}}} to {{{ec2 land}}} or {{{bzr lp-land}}}.
  * What the tagger does: Each related bug is tagged qa-rollback. The status of the bug will remain the same.

Note: Regular branches that fix qa-bad bugs should be submitted like category 1.
||<tablestyle="width: 80%;" colspan=3 style="background: #FF6633; font-weight: bold; color: #fff;">NOTE:||<style="background: #FF6633; font-weight: bold; color: #fff;"> Developers shouldn't use the {{{--incremental}}} option when landing the last branch in an incremental chain. Branch should be submitted like the most common case.||
Line 57: Line 70:
PQM will enforce these rules with the usual regex dances. {{{ec2 land}}} and {{{bzr lp-land}}} help you conform to the PQM regex with quicker and more helpful error messages. Alternatively, you can add "[incr]", "[no-qa]" or "[rollback]" in your PQM submission message yourself, if using pqm-submit directly, but we don't recommend it. === We cannot QA the branch, but it fixes one or more bugs ===

  * '''Developer action''': Link the bug and the branch in Launchpad (see alternative above), and use {{{--no-qa}}} on {{{ec2 land}}} or {{{bzr lp-land}}}.
{{{
      $ ./ec2 land --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Each related bug is marked Fix Committed and tagged qa-untestable.

=== We cannot QA it, and it does not have an associated bug ===

  * '''Developer action''': Use {{{--no-qa}}} on {{{ec2 land}}} or {{{bzr lp-land}}}.
{{{
      $ ./ec2 land --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Nothing. We include it in a QA report for the current cycle (just a wiki page for now).

=== We cannot QA it, and it's just a rollback of a previous qa-bad or blocker qa-needstesting branch ===

  * '''Developer action''': Use {{{--rollback}}} on {{{ec2 land}}} or {{{bzr lp-land}}}.
{{{
      $ ./ec2 land --rollback=BROKENBRANCHREVNO https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
}}}
  * '''Tagger action''': Each bug has the qa-bad tag removed putting it back to no qa tags, and the bad-commit-* tag left in place. The status of the bug will remain the same.

||<tablestyle="width: 80%;" colspan=3 style="background: #FF6633; font-weight: bold; color: #fff;">NOTE:||<style="background: #FF6633; font-weight: bold; color: #fff;">Regular branches that fix qa-bad bugs should be submitted like the most common case. ||
Line 60: Line 97:
== What the new blesser should do? == PQM will enforce these rules with the usual regex dances. {{{ec2 land}}} and {{{bzr lp-land}}} help the developer conform to the PQM regex with quicker and more helpful error messages. Alternatively, the developer can add "[incr]", "[no-qa]" or "[rollback=xxxxx]" in the PQM submission message, if using pqm-submit directly, but it's not recommended considering it's not needed and other tools with faster response automatically check and enforce the tags.
Line 62: Line 99:
The very important part of having the bugs tagged correctly is that this will determine the QA state of the branch that fixes it, and as a consequence say if the revision is ok to be rolled out to production or not.
Line 64: Line 100:
The blesser will check each revision for a bug, and: == Marking revisions as blessed: the blesser ==
Line 66: Line 102:
1) If there isn't a bug, it assumes the revision as qa-untestable, revision is blessed.
2) If there's a bug and it's qa-untestable, qa-ok or qa-rollback, revision is blessed.
3) If there's a bug and it's qa-needstesting or qa-bad, revision is not blessed.
The very important part of having the bugs tagged correctly is that this will determine the QA state of the branch that fixes it, and as a consequence say if the revision is '''''blessed''''' to be rolled out to production of if it's '''''blocked''''', and therefore should not be rolled out.

A small application, "the blesser", will check each revision landed on the development branch, check the existence of bugs and commit messages, and mark them as follows:

 1. Has '''no bug''': Blesser assumes the revision is '''qa-untestable''', therefore revision is '''blessed'''.
 2. '''Has bug''' and it's '''qa-untestable''', '''qa-ok''' or '''qa-rollback''': Blesser assumes that's ok, therefore revision is '''blessed'''.
 3. '''Has bug''' and it's '''qa-needstesting'''
 4. '''Has bug''' tagged '''qa-bad''': Blesser blocks the rollouts by marking the revision as '''blocked''' unless a later revision has rollback=xxx where xxx is this revision.
 4. '''Has bug''' and has no QA tags (e.g. removed manually): Blesser blocks the rollouts by marking the revision as '''blocked'''.

Here is a diagram that shows how developers and the [[http://launchpad.net/qa-tagger|tagger]] script will interact with bugs, leaving them ready for the blesser:

{{attachment:bug_machine_statev2.png}}

=== The Blesser Implementation ===

The dev notes for the blesser tool are on the [[QAShepherd]] page.

Continuous Rollouts Process: the QA side

The MergeWorkflow relies on QA, enough to assume a branch able (or not) to be rolled out to production based on its QA state.

We need to do the bookkeeping to provide the QA information to the mechanism that will do the rollouts. Details on how we intent to do this are described in this wiki page.

Definition of QA

A bug is the smallest unit of QA. So, deciding if something needs QA is based on the existence of the bug. But, it's NOT required to have a bug for each branch. Informing that a branch is unQAable when landing it will QA-cover it.

A fix is considered QAed when falling into one of the following categories:

States of QA

  • qa-ok: The branch is verified and implements successfully what it proposes.
  • qa-untestable: The branch cannot be tested separately of the rest of the fix or cannot be tested at all, and is harmless.
  • qa-bad: The branch is verified and doesn't work as it should or causes regressions. This is derived by having a bad-commit with no rollback=XXX for it in devel. bad-commit tags are of the form bad-commit-REVNOINDEVEL.
  • qa-needstesting: The branch has landed and is waiting to be QAed.

qa-untestable, and qa-needstesting should be set by the tagger. qa-bad and qa-ok should be manually set by the developer. The diagram at the end of this page shows the QA states of the bug and the changes that trigger them.

Connecting branches and QA

As a rule, if a branch needs QA, it should be represented by at least one bug. Rarely, QA is not necessary for some branches, or can't be done. Also rarely, some branches cannot be QA'd until more branches land -- they are incremental branches towards a larger bug. Equally rarely are expected branches that only revert others that are bad fixes or rollout blockers: they rollback other branches.

How to make branches QA-aware when landing them

To represent and sign those situations, there are three new commit message tags: [no-qa], [incr] and [rollback=xxx]. Note that the idea is to gather as much information as possible in the merge proposal, so the developer only has to use parameters on ec2 land and bzr lp-land instead of handcrafting the commit message for it to be recognized as in a QA-consistent state.

The developer should set the commit message in the merge proposal, without worrying about the QA clauses (incremental, bug, no-qa and rollback), and the helper scripts should generate the correct PQM commit message.

Each category below describes what the developer needs to do to make the assertion. It also tells the developer what automation it will trigger. For simplicity we're using ec2 land in all the examples.

ec2 land will check in the merge proposal for all bugs that aren't Fix Committed or Fix Released, and then add their numbers to the [bug=] clause in the commit message to be sent to PQM. If no bugs within these rules are found, and the branch isn't explicitly told as [no-qa], the command should fail. In such cases you should or file a new bug, linking it to the branch, or set the proper existing bug's status to In Progress.

In order to get the branch landed, the developer must assert that the branch falls in one of the following categories:

We can QA the branch, and it fixes one or more bugs (most common)

  • Developer action: Link the bug to the branch in Launchpad (see alternative below), and use ec2 land or bzr lp-land:

      $ ./ec2 land https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Each related bug is marked Fix Committed and tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in.

TIP

Alternative way to link bugs to branches in Launchpad, automatically: Instead of accessing the branch page in Launchpad and linking the bugs manually after pushing it, the developer can use bzr commit --fixes=123456. It adds the information of the bug fixed in the branch metadata. When the same branch is pushed to Launchpad, it's scanned and provided fixed bugs are automatically linked to the branch in Launchpad.

We can QA the branch, and it is an incremental step towards the fix of one or more bugs

  • Developer action: Link the bug to the branch in Launchpad (see alternative above), and use --incremental on ec2 land or bzr lp-land.

      $ ./ec2 land --incremental https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Each related bug is tagged qa-needstesting, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.

We cannot QA the branch, and it is an incremental step towards the fix of one or more bugs

  • Developer action: Link the bug to the branch in Launchpad (see alternative above), and use --incremental and --no-qa on ec2 land or bzr lp-land.

      $ ./ec2 land --incremental --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Each related bug is tagged qa-untestable, and a comment is added mentioning the revision number and branch name it landed in. The status of the bug will remain In Progress.

NOTE:

Developers shouldn't use the --incremental option when landing the last branch in an incremental chain. Branch should be submitted like the most common case.

We cannot QA the branch, but it fixes one or more bugs

  • Developer action: Link the bug and the branch in Launchpad (see alternative above), and use --no-qa on ec2 land or bzr lp-land.

      $ ./ec2 land --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Each related bug is marked Fix Committed and tagged qa-untestable.

We cannot QA it, and it does not have an associated bug

  • Developer action: Use --no-qa on ec2 land or bzr lp-land.

      $ ./ec2 land --no-qa https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Nothing. We include it in a QA report for the current cycle (just a wiki page for now).

We cannot QA it, and it's just a rollback of a previous qa-bad or blocker qa-needstesting branch

  • Developer action: Use --rollback on ec2 land or bzr lp-land.

      $ ./ec2 land --rollback=BROKENBRANCHREVNO https://code.launchpad.net/~developer/launchpad/the-branch-bug-1234/+merge/66666
  • Tagger action: Each bug has the qa-bad tag removed putting it back to no qa tags, and the bad-commit-* tag left in place. The status of the bug will remain the same.

NOTE:

Regular branches that fix qa-bad bugs should be submitted like the most common case.

PQM will enforce these rules with the usual regex dances. ec2 land and bzr lp-land help the developer conform to the PQM regex with quicker and more helpful error messages. Alternatively, the developer can add "[incr]", "[no-qa]" or "[rollback=xxxxx]" in the PQM submission message, if using pqm-submit directly, but it's not recommended considering it's not needed and other tools with faster response automatically check and enforce the tags.

Marking revisions as blessed: the blesser

The very important part of having the bugs tagged correctly is that this will determine the QA state of the branch that fixes it, and as a consequence say if the revision is blessed to be rolled out to production of if it's blocked, and therefore should not be rolled out.

A small application, "the blesser", will check each revision landed on the development branch, check the existence of bugs and commit messages, and mark them as follows:

  1. Has no bug: Blesser assumes the revision is qa-untestable, therefore revision is blessed.

  2. Has bug and it's qa-untestable, qa-ok or qa-rollback: Blesser assumes that's ok, therefore revision is blessed.

  3. Has bug and it's qa-needstesting

  4. Has bug tagged qa-bad: Blesser blocks the rollouts by marking the revision as blocked unless a later revision has rollback=xxx where xxx is this revision.

  5. Has bug and has no QA tags (e.g. removed manually): Blesser blocks the rollouts by marking the revision as blocked.

Here is a diagram that shows how developers and the tagger script will interact with bugs, leaving them ready for the blesser:

bug_machine_statev2.png

The Blesser Implementation

The dev notes for the blesser tool are on the QAShepherd page.

QAProcessContinuousRollouts (last edited 2010-11-08 10:39:06 by henninge)