lp:~cjwatson/launchpad

Owned by Colin Watson
Get this repository:
git clone https://git.launchpad.net/~cjwatson/launchpad
Only Colin Watson can upload to this repository. If you are Colin Watson please log in for upload directions.

Branches

Name Last Modified Last Commit
simple-open-leaks 2022-11-25 22:42:59 UTC
Plug several simple open() resource leaks

Author: Colin Watson
Author Date: 2022-11-25 22:42:59 UTC

Plug several simple open() resource leaks

Brought to you by some initial experiments with
https://pypi.org/project/pyastgrep/:

  pyastgrep './/Call/func/Attribute[@attr="read" or @attr="write"]/value/Call/func/Name[@id="open"]'

factory-proxy-previewdiff 2022-11-25 20:53:50 UTC
Return proxied object from makePreviewDiff

Author: Colin Watson
Author Date: 2022-11-25 20:53:50 UTC

Return proxied object from makePreviewDiff

`LaunchpadObjectFactory` issues `UnproxiedFactoryMethodWarning` when its
methods return objects not wrapped in a security proxy, since that tends
to result in tests that are less accurate simulations of production.

sitesearch-testservice-cleanup 2022-11-25 19:13:53 UTC
Connect stdin/stdout of site search test service to /dev/null

Author: Colin Watson
Author Date: 2022-11-25 19:11:42 UTC

Connect stdin/stdout of site search test service to /dev/null

Setting these up as pipes without having anything ever communicate with
it, as we previously did, had two disadvantages: it could cause the test
service to block if it tries to write too much to stdout, and it caused
a `ResourceWarning` due to `proc.stdout` never being explicitly closed.

git-builder-constraints 2022-11-25 18:26:40 UTC
Add API/UI for setting builder constraints on Git repositories

Author: Colin Watson
Author Date: 2022-11-25 18:26:39 UTC

Add API/UI for setting builder constraints on Git repositories

Using a `DelimitedListWidget` for this is pretty ugly (it just gives you
a text area and splits what you enter on whitespace), but it's
functional, and this is only visible to admins anyway.

I believe the `launchpad.Admin` permission on repositories was
previously unused, so I repurposed it for this since some builder
resources will be restricted.

fix-builder-resources 2022-11-25 18:01:47 UTC
Fix test failure in xx-builders.rst

Author: Colin Watson
Author Date: 2022-11-25 18:01:47 UTC

Fix test failure in xx-builders.rst

master 2022-11-25 15:56:21 UTC
Allow partitioning build farm by resources

Author: Colin Watson
Author Date: 2022-11-25 15:56:21 UTC

Allow partitioning build farm by resources

Merged from https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/433380

remove-snap-webhooks-enabled-rule 2022-11-25 15:53:04 UTC
Remove snap.webhooks.enabled feature rule

Author: Colin Watson
Author Date: 2022-11-25 15:53:04 UTC

Remove snap.webhooks.enabled feature rule

It's been enabled everywhere for some time.

requests-session-cleanup 2022-11-25 11:13:04 UTC
Close requests sessions more promptly

Author: Colin Watson
Author Date: 2022-11-25 11:13:04 UTC

Close requests sessions more promptly

This fixes a number of particularly obscure-looking `ResourceWarning`s
from the test suite that look something like this:

  ResourceWarning: unclosed <socket.socket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 46726), raddr=('127.0.0.1', 39003)>

(I finally got curious enough about this to put a breakpoint at the top
of `lp.scripts.utilities.warninghandler.launchpad_showwarning` so that I
could track it down.)

I haven't fixed the case in `ArtifactoryPool` because the disk pool API
makes that difficult and will need more extensive refactoring; I've just
left an XXX comment for now.

This looks long, but it's almost entirely reindentation due to using
sessions as context managers.

merge-db-stable 2022-11-24 17:56:01 UTC
Add columns for builder resources and constraints

Author: Colin Watson
Author Date: 2022-11-24 17:56:01 UTC

Add columns for builder resources and constraints

Merged from https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/433377

tighten-upload-log-navigation 2022-11-24 11:53:10 UTC
Factor out common regex into a function

Author: Colin Watson
Author Date: 2022-11-24 11:53:10 UTC

Factor out common regex into a function

personal-access-token-git 2022-11-23 18:10:30 UTC
Allow authenticating to git using access tokens

Author: Colin Watson
Author Date: 2022-11-23 18:10:26 UTC

Allow authenticating to git using access tokens

We added personal access tokens last year for some initial webservice
API use cases, and with the intention of eventually extending them for
git authentication as well, but never quite got round to the latter.
This commit adds a new `repository:pull` scope to go with the
previously-unimplemented `repository:push` scope, and implements both of
those for git authentication over HTTPS.

The way that the git XML-RPC endpoint works means that we have to do
this in a few different places: the initial entry point for HTTPS is
`authenticateWithPassword`, which just verifies that the username and
access token match and returns some information about them which turnip
sends along with later calls. Those later calls (`translatePath`,
`checkRefPermissions`, etc., which can only be called after successful
authentication) then each need to handle more specific checks on the
access token, such as whether it's for the correct repository and
whether it permits pulling or pushing as appropriate. Fortunately, the
same general idea was already in place for macaroon authentication, so
for the most part we can just extend that.

This introduces the novel-to-Launchpad feature of a token that permits
pushing but not pulling. While I don't have a specific use case for
this, I didn't think it was wise to just have any token allow pulling
(since the `repository:build_status` scope currently only allows using
some specific webservice API endpoints), and it seemed clearer to add a
specific scope than to have `repository:push` imply `repository:pull`.
I've made sure that this works correctly with a real git client.

Once this is deployed to production, we can switch `snapcraft
remote-build` over to use this instead of macaroons, and then begin the
process of deprecating user macaroons for git.

LP: #1995535

db-devel 2022-11-22 19:10:27 UTC
Automatic merge from stable up to 5aee8f659f6d

Author: Patch Queue Manager
Author Date: 2022-11-22 19:10:27 UTC

Automatic merge from stable up to 5aee8f659f6d

repository-fork-api 2022-10-25 07:35:50 UTC
Allow forking Git repositories via the API

Author: Colin Watson
Author Date: 2022-10-25 07:35:50 UTC

Allow forking Git repositories via the API

This would be useful to the kernel team, in particular.

scan-generic-detect-float-version 2022-10-03 12:52:23 UTC
Explicitly check type of report's version property

Author: Colin Watson
Author Date: 2022-10-03 12:52:23 UTC

Explicitly check type of report's version property

This is an easy mistake to make in YAML, so check for it explicitly to
avoid a confusing OOPS later on.

lpcraft-pre-commit 2022-08-03 17:45:03 UTC
Run pre-commit checks via Launchpad CI jobs

Author: Colin Watson
Author Date: 2022-06-17 11:59:10 UTC

Run pre-commit checks via Launchpad CI jobs

db-narrow-bpr-ci-build-unique-index-cleanup 2022-06-22 13:25:35 UTC
Drop BPR (ci_build, binarypackagename) index

Author: Colin Watson
Author Date: 2022-06-22 13:25:35 UTC

Drop BPR (ci_build, binarypackagename) index

Replaced by a unique index that also includes
`BinaryPackageRelease.binpackageformat`.

remove-dbschemaapi 2021-11-19 10:56:18 UTC
Remove deprecated DBSchemaAPI TALES adapter

Author: Colin Watson
Author Date: 2021-11-19 10:56:18 UTC

Remove deprecated DBSchemaAPI TALES adapter

This was deprecated long ago and is no longer used (difficult to search
for, but confirmed by a full test run).

merge-snap-build-channels-widgets 2021-11-09 20:57:16 UTC
Convert charm recipes to use the common SnapBuildChannelsWidget

Author: Colin Watson
Author Date: 2021-11-09 20:57:16 UTC

Convert charm recipes to use the common SnapBuildChannelsWidget

snap-build-channels-field 2021-11-09 19:00:51 UTC
Refactor field declarations for snap build channels

Author: Colin Watson
Author Date: 2021-11-09 19:00:51 UTC

Refactor field declarations for snap build channels

We were repeating the list of known core snaps in quite a lot of places.
Start the process of reducing this by introducing a
`SnapBuildChannelsField`, used instead of several similar `Dict` field
declarations.

numbercruncher-empty-build-queues 2021-10-29 22:34:26 UTC
Send buildqueue gauges for active builders with empty queues

Author: Colin Watson
Author Date: 2021-10-29 22:34:26 UTC

Send buildqueue gauges for active builders with empty queues

If builders for a (processor name, virtualized) combination exist but
have no queued builds, we should still send a zero value for the
corresponding `buildqueue` gauge, as otherwise we end up with unsightly
gaps in graphs.

librarian-new-container-workaround 2021-07-15 10:35:08 UTC
Allow librarian-feed-swift to sleep after creating container

Author: Colin Watson
Author Date: 2021-07-15 10:35:08 UTC

Allow librarian-feed-swift to sleep after creating container

radosgw apparently has a bug where newly-created containers need to be
left idle for a short time before they can be used reliably. For now,
allow working around this by configuring
`librarian_server.new_container_delay` to a number of seconds to sleep
after creating a new container.

See https://portal.admin.canonical.com/C131836.

stop-ppa-key-propagation 2020-10-21 19:24:59 UTC
Stop propagating signing keys between an owner's PPAs

Author: Colin Watson
Author Date: 2020-10-21 19:24:59 UTC

Stop propagating signing keys between an owner's PPAs

Things were perhaps different in 2009 when this feature was designed,
but add-apt-repository has dealt with fetching keys on a per-archive
basis for a long time now, and it makes more sense for keys to be
per-archive. This also improves behaviour for users whose default
archive was created long enough ago that it has a 1024-bit signing key.

LP: #1700167

archive-file-history-backfill 2020-09-15 17:40:02 UTC
Backfill ArchiveFile.date_superseded

Author: Colin Watson
Author Date: 2020-09-15 17:40:02 UTC

Backfill ArchiveFile.date_superseded

We can currently derive this reliably from
ArchiveFile.scheduled_deletion_date, and doing so gives us a chance of
historical queries being mostly accurate.

LP: #1765933

archive-file-history 2020-09-14 12:19:11 UTC
Turn ArchiveFile into a history table

Author: Colin Watson
Author Date: 2018-04-21 11:10:19 UTC

Turn ArchiveFile into a history table

This adds date_created and date_superseded columns. Adjust the
publisher to match.

LP: #1765933

unreplicated-means-primary 2020-07-01 10:36:15 UTC
Always use the primary DB in unreplicated environments

Author: Colin Watson
Author Date: 2020-07-01 10:36:15 UTC

Always use the primary DB in unreplicated environments

If there's no replication, it doesn't make sense to keep trying to talk
to a possibly-broken standby. Just use the primary instead.

LP: #1885859

fix-ui-oci-reg-creds 2020-05-11 23:03:04 UTC
Fix OCIEditRegistryCredentialsView field handling

Author: Colin Watson
Author Date: 2020-05-11 22:58:05 UTC

Fix OCIEditRegistryCredentialsView field handling

This reworks the field layout and parsing along the same lines as the
similar table in GitRepositoryPermissionsView.

The update logic is now easier to follow, because the business of
parsing data from the form is separated from the business of applying
the changes to the database. Updates are done by iterating over the
parsed form rather than iterating over the existing credentials, because
there's no guarantee that the latter match what existed at the time the
form was generated, and we check for mismatches (of the form of an
attempt to update a credentials row with a nonexistent ID or one that
isn't owned by the context person).

The template now has a way to get hold of the widgets for a given
OCIRegistryCredentials object, rather than trying to reuse the same
widgets on each row of the table.

built-using-domination 2020-04-23 16:46:39 UTC
Fix calculation of live source versions

Author: Colin Watson
Author Date: 2020-04-23 16:46:39 UTC

Fix calculation of live source versions

The dominator previously incorrectly reinstated source publications if
they were the latest one being considered for domination, even if that
was an inactive publication with only inactive Built-Using references.

built-using-guard-copying 2020-04-22 20:00:14 UTC
Guard copies of binaries with Built-Using references

Author: Colin Watson
Author Date: 2020-04-22 19:56:17 UTC

Guard copies of binaries with Built-Using references

If binaries have Built-Using references, then we need to make sure that
we can resolve those references and keep the corresponding sources
published while the binaries are published. Prevent copies of binaries
if any such references can't be resolved in the target publishing
context.

LP: #1868558

built-using-guard-deletion 2020-04-22 19:59:22 UTC
Simplify tests using createFromSourcePackageReleases

Author: Colin Watson
Author Date: 2020-04-22 16:54:25 UTC

Simplify tests using createFromSourcePackageReleases

simplify-external-translation-messages 2020-04-01 21:16:23 UTC
Simplify POTMsgSet._getExternalTranslationMessages

Author: Colin Watson
Author Date: 2020-04-01 21:16:23 UTC

Simplify POTMsgSet._getExternalTranslationMessages

There's no obvious point to sorting the results of a subquery and then
passing it straight to the IN operator; this seems to be a vestige of
earlier code that fetched the result of the subquery into Python. This
doesn't seem to make a massive difference (though it's a bit hard to
tell due to caching), but it at least simplifies the query plan.

LP: #736005

db-potmsgset-msgid-plural-idx 2020-04-01 20:32:11 UTC
Index POTMsgSet(msgid_plural)

Author: Colin Watson
Author Date: 2020-04-01 20:32:11 UTC

Index POTMsgSet(msgid_plural)

This is used by POFileMixIn._getTemplateSearchQuery. Adding this index
probably won't fix timeouts on its own, but it certainly helps avoid
some full table scans.

LP: #736005

livefs-build-pocket 2019-10-08 08:27:21 UTC
Allow livefs build metadata to override the default build pocket.

Author: Colin Watson
Author Date: 2019-09-06 23:53:16 UTC

Allow livefs build metadata to override the default build pocket.

This makes it possible, for example, to distinguish the case of building a
livefs using tools from -updates but with contents from the release pocket
from the case of building a livefs using tools from -updates and contents
from -updates.

snap-check-request-private-git 2019-10-07 16:46:44 UTC
Check that the snap owner has read access to the repository, rather than that...

Author: Colin Watson
Author Date: 2019-03-28 14:59:34 UTC

Check that the snap owner has read access to the repository, rather than that owners match.

login-interstitial 2019-10-07 13:53:48 UTC
Add interstitial pages when creating or reactivating an account.

Author: Colin Watson
Author Date: 2018-05-25 22:18:52 UTC

Add interstitial pages when creating or reactivating an account.

These provide an opportunity to present the user with the terms of service
and privacy policy and require that they explicitly accept them, as well as
making it harder to reactivate an account by accident.

To support testing this locally, I extended make-lp-user to be able to
create placeholder accounts, and adjusted testopenid so that it can
authenticate as an inactive account by explicitly supplying the username.

sourcedeps-codetree 2019-10-07 12:45:07 UTC
Replace most of devscripts.sourcecode with codetree.

Author: Colin Watson
Author Date: 2017-11-01 01:09:59 UTC

Replace most of devscripts.sourcecode with codetree.

git-subscriptions-by-path 2019-10-07 11:21:23 UTC
Make GitSubscription.paths be a JSON-encoded list instead.

Author: Colin Watson
Author Date: 2016-11-17 15:00:35 UTC

Make GitSubscription.paths be a JSON-encoded list instead.

opt-in-zopeless-immediate-mail 2019-10-07 09:59:51 UTC
Drop immediate mail delivery from LaunchpadScript and LaunchpadZopelessLayer.

Author: Colin Watson
Author Date: 2015-09-08 11:35:19 UTC

Drop immediate mail delivery from LaunchpadScript and LaunchpadZopelessLayer.

137 of 37 results
This repository contains Public information 
Everyone can see this information.

Subscribers