Merge lp://staging/~bryce/launchpad/lp-617679-db into lp://staging/launchpad/db-devel

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: no longer in the source branch.
Merged at revision: 9805
Proposed branch: lp://staging/~bryce/launchpad/lp-617679-db
Merge into: lp://staging/launchpad/db-devel
Diff against target: 68 lines (+53/-0)
2 files modified
database/schema/comments.sql (+15/-0)
database/schema/patch-2208-09-0.sql (+38/-0)
To merge this branch: bzr merge lp://staging/~bryce/launchpad/lp-617679-db
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Robert Collins (community) database Approve
Review via email: mp+34321@code.staging.launchpad.net

Commit message

New tables for mapping upstream components to source packages.

Description of the change

This branch is a foundation for changes to add support for mapping additional form data for external bug trackers, in order to simplify the process of forwarding bug reports upstream.

Specifically, it adds tables for components and component groups (aka 'products' in bugzilla). A bug tracker can have one or many component groups, and each component group can have any number of components. Components are the equivalent to distro source packages, and we allow linkages to be made between them.

These tables will be filled via a daily cron script that retrieves the data from the upstream bug trackers. Users can add to or delete items as well. The is_custom flag allows marking user-added items (which should not be removed by the cron job). The is_active flag allows the user to disable/hide synced components which are not relevant.

pre-implementation and mid-implementation discussions of this feature were done with Deryck and Graham.

The branch has passed 'make schema', and I've verified the patch applies. I've run it through ec2 test successfully as well.

Tests started at approximately Wed, 01 Sep 2010 18:27:10 UTC
bzr+ssh://bazaar.launchpad.net/~launchpad-pqm/launchpad/db-devel/, revision 9734

Merged with
bzr+ssh://bazaar.launchpad.net/~bryceharrington/launchpad/lp-617679-db, revision 9705

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

OMMENT ON COLUMN BugTrackerComponent.is_active IS 'Whether to display or hide the item in the Launchpad user interface.';

perhaps is_shown, if that is what you mean.

If you mean that bugwatches etc will ignore it in future, then the comment is wrong. Either way something is mismatched.

I don't parse ." Some bug trackers do not group components thus all BugTrackerComponents will belong to a default componentgroup.';" easily; could you consider expanding or rephrasing. For instance, do you mean 'one default componentgroup for all trackers'.

source_package->distro_source_package please, for clarity

If these are going to be shown in LP, and traversed to, they have to have a constraint on the name to match our url restrictions; if they aren't, then you may have some difficulty writing uis for them. If the contstraint will conflict with external names (e.g. someone has a component called Foo and the capital letter matters), then you need two fields: a field for LP to use and a field for the external tracker. (Or, don't ever traverse to these things in the web UI/API).

review: Approve (database)
Revision history for this message
Robert Collins (lifeless) wrote :

Approved with the tweaks above. Stuart will have more for you on the schema itself.

Revision history for this message
Stuart Bishop (stub) wrote :

Allocated DB patch is patch-2208-09-0.sql

Missing constraint on BugTrackerComponentGroup:

ALTER TABLE BugTrackerComponentGroup
    ADD CONSTRAINT bugtrackercomponentgroup__bug_tracker__name__key
    UNIQUE (bug_tracker, name);

The bugtrackercomponentgroup__bugtracker__idx index is incorrect (you reference the wrong table). I suspect you wanted the index on BugTrackerComponentGroup(bugtracker), which is now unnecessary with the above constraint, so just drop it.

On BugTrackerComponent:

    - you are declaring the source_package foreign key twice. Either remove the REFERENCES clause in the column definition, or the CONSTRAINT clause after the column definitions.

    - The boolean columns are missing NOT NULL constraints.

    - Missing constraint on (component_group, name).

      ALTER TABLE BugTrackerComponent
        ADD CONSTRAINT bugtrackercomponent__component_group__name__key
        UNIQUE (component_group, name);

    - The bugtrackercomponent__componentgroup__idx index becomes unnecessary
      with the above constraint.

    - I'm not sure if source_package should be UNIQUE. I suspect it is.

      ALTER TABLE BugTrackerComponent
        ADD CONSTRAINT bugtrackercomponent__source_package__key
        UNIQUE (source_package);

    - If the above UNIQUE constraint on source_package is added, the
      bugtrackercomponent__distributionsourcepackage__idx index is
      unnecessary. It has the wrong name anyway
      (bugtrackercomponent__source_package__idx).

review: Needs Fixing (db)
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks, I've updated the branch with this feedback. Please doublecheck that I've done the constraint for the name properly.

Robert, I'm a little fuzzy on what you mean by 'traverse to'. If you mean, can the bugzilla component text appear in a link on a launchpad webpage, yes that is part of the intent of this. Is the valid_name constraint sufficient, or do I need to add a separate field like 'displayname'?

Revision history for this message
Robert Collins (lifeless) wrote :

valid_name is sufficient, as long as that is sufficient for the bug
trackers we're talking to.

traverse to - 'generate urls to it in the web UI/API' - as in, if you
embed it in a page, name won't matter; if we call canonical_url() on
something, the result has to meet the validity constraints for all our
urls.

Revision history for this message
Stuart Bishop (stub) wrote :

Fine.

Consider is_visible rather than is_shown - we use visible elsewhere but 'shown' might be more appropriate here.

review: Approve (db)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: