# How-to guides

Instructions to take you through common processes for Launchpad developers, from
creating a local setup and contributing changes, to operating and debugging the
platform.

## Get started

To get started with Launchpad development, you’ll need to get the source code
and run a local Launchpad instance. You can also set up Buildd and Soyuz to
enable local builds.

- [Get the Launchpad source code](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/get-source-code/index.html.md#get-the-source-code)
- [Run Launchpad locally with quick set up](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/running-quickstart/index.html.md#set-up-and-run-launchpad-quickstart)
- [Run Launchpad locally with advanced set up](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/running/index.html.md#set-up-and-run-launchpad-advanced)
- [Set up the database](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/database-setup/index.html.md#database-setup)
- [Deploy Soyuz locally](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/use-soyuz-locally/index.html.md#use-soyuz-locally)
- [Develop with Buildd](https://ubuntu.com/docs/launchpad/developer/how-to/get-started/develop-with-buildd/index.html.md#develop-with-buildd)

## Operate Launchpad

Managing a running Launchpad instance involves monitoring the build farm,
checking frontend availability, triaging bugs, administering users, and
shipping changes to production.

- [Get overview of build farm](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/getting-overview-of-build-farm/index.html.md#get-overview-of-build-farm)
- [Check availability of frontends](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/checking-availability-of-launchpad-frontends/index.html.md#check-availability-of-frontends)
- [Manage users and teams in development environments](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/manage-users/index.html.md#manage-users-and-teams-in-development-environments)
- [Create job to publish artifact](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/create-job-publish-artifact/index.html.md#create-job-to-publish-artifacts)
- [Triage Launchpad project bugs](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/triage-bugs/index.html.md#triaging-launchpad-project-bugs)
- [Land updates for Loggerhead](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/land-update-for-loggerhead/index.html.md#land-updates-loggerhead)
- [Build and publish Launchpad development LXD images](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/building-lpdev-images/index.html.md#build-and-publish-launchpad-development-lxd-images)
- [Use lp-shell](https://ubuntu.com/docs/launchpad/developer/how-to/operate-launchpad/use-lp-shell/index.html.md#how-to-use-lp-shell)

## Common development tasks

The Launchpad development cycle involves fixing bugs, contributing and
reviewing changes, updating dependencies, and keeping the database schema
current.

- [Fix bugs](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/fixing-bugs/index.html.md#fixing-bugs)
- [Contribute changes](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/contributing-changes/index.html.md#contributing-changes)
- [Use an updated dependency](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/use-updated-dependency/index.html.md#use-updated-dependency)
- [Create a database patch](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/create-a-db-patch/index.html.md#create-a-db-patch)
- [Apply database schema changes](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/apply-schema-changes/index.html.md#apply-database-schema-changes)
- [Import an Ubuntu package](https://ubuntu.com/docs/launchpad/developer/how-to/common-development-tasks/importing-an-ubuntu-package/index.html.md#import-ubuntu-package)

## Launchpad development tips

This section covers a range of helpful techniques for Launchpad development:
writing and configuring tests, handling exceptions and security policies,
running codehosting locally, generating API docs, and working with the
database.

- [Update the global configuration for tests](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/update-configuration-for-testing/index.html.md#update-global-configuration-for-tests)
- [Handle security policies](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/security/index.html.md#handle-security-policies)
- [Test CLI scripts](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/testing-scripts/index.html.md#test-cli-scripts)
- [Handle exceptions](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/exceptions/index.html.md#handle-exceptions)
- [Preserve query count](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/preserve-query-count/index.html.md#preserve-query-count)
- [Profile Launchpad performance](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/profile-launchpad/index.html.md#profile-launchpad)
- [Run Launchpad with Chameleon template engine](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/chameleon/index.html.md#run-launchpad-with-chameleon-template-engine)
- [Generate Launchpad API docs](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/launchpad-api-docs/index.html.md#launchpad-api-docs-generation)
- [Use codehosting locally](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/codehosting-locally/index.html.md#use-codehosting-locally)
- [Rename a database table](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/rename-database-table/index.html.md#rename-database-table)
- [Use MockIo library](https://ubuntu.com/docs/launchpad/developer/how-to/launchpad-development-tips/mockio/index.html.md#mockio-library)

## Debug

Launchpad’s layered architecture means bugs can surface far from their origin.
Visual Studio Code has features that can be useful when debugging. Using `pdb`
breakpoints to debug pagetests can make your development experience easier.
However, you can also run into some issues when using breakpoints to
troubleshoot across multiple test layers.

- [Debug tests with Visual Studio Code](https://ubuntu.com/docs/launchpad/developer/how-to/debug/debug-with-visual-studio-code/index.html.md#debug-with-visual-studio-code)
- [Debug stories and pagetests](https://ubuntu.com/docs/launchpad/developer/how-to/debug/debugging/index.html.md#debug-stories-pagetests)
- [Troubleshoot breakpoint issues when running multiple test layers](https://ubuntu.com/docs/launchpad/developer/how-to/debug/troubleshoot-breakpoint-issues-when-running-tests/index.html.md#troubleshoot-breakpoints-tests)

## Testing

Launchpad has a large test suite. These guides cover running the tests locally
and, over time, writing them and measuring their coverage.

- [Running tests](https://ubuntu.com/docs/launchpad/developer/how-to/testing/running-tests/index.html.md#running-tests)
