# Management Commands - [Management Commands](#management-commands) - [`boost_setup`](#boost_setup) - [`import_versions`](#import_versions) - [`import_archives_release_data`](#import_archives_release_data) - [`update_libraries`](#update_libraries) - [`import_library_versions`](#import_library_versions) - [`import_library_version_docs_urls`](#import_library_version_docs_urls) - [`update_maintainers`](#update_maintainers) - [`update_authors`](#update_authors) - [`import_commits`](#import_commits) - [`update_issues`](#update_issues) - [`import_beta_release`](#import_beta_release) - [`sync_mailinglist_stats`](#sync_mailinglist_stats) - [`update_library_version_dependencies`](#update_library_version_dependencies) - [`release_tasks`](#release_tasks) - [`refresh_users_github_photos`](#refresh_users_github_photos) - [`clear_slack_activity`](#clear_slack_activity) ## `boost_setup` Runs the management commands required to populate the Boost database from scratch with Boost versions, libraries, and other associated data. Read more about `boost_setup` in [Populating the Database for the First Time](./first_time_data_import.md). **Example** ```bash ./manage.py boost_setup ``` **Options** | Options | Format | Description | |----------------------|--------|--------------------------------------------------------------| | `--token` | string | GitHub API Token. If passed, will use this value. If not passed, will use the value in settings. | **Process**: See [Populating the Database for the First Time](./first_time_data_import.md). ## `import_versions` Imports `Version` objects from GitHub. **Example** ```bash ./manage.py import_versions ``` **Options** | Options | Format | Description | |----------------------|--------|---------------------------------------------------------------------------------------------------------| | `--delete-versions` | bool | If passed, will delete all Version objects before importing Versions. | | `--new` | bool | Default: 'true'. If 'true', will import only new Version objects. Set to 'false' to import all versions | | `--token` | string | GitHub API Token. If passed, will use this value. If not passed, will use the value in settings. | **Process** - Retrieves the tags for the GitHub repo in `BASE_GITHUB_URL` - Loops through all tags, and discards any that do not match our inclusion logic, by default only versions that haven't already been imported. - For each successful tag, import it as a `Version` object - Then, run the command to the release downloads from Artifactory as `VersionFile` objects ## `import_archives_release_data` *This process is run automatically as part of `import_versions`.* Import `VersionFile` objects from Artifactory. **Example** ```bash ./manage.py import_archives_release_data ``` **Options** | Options | Format | Description | |------------|--------|------------------------------------------------------------------------------------------------------------------------------| | `--new` | bool | Default: 'true'. If 'true', will import only the newest release data. Set to 'false' to import archive data for all releases | | `--release` | string | Format: `boost-1.63.0`. If passed, will import Archive urls for only that release. Overrides --new | **More Information** - Loops through `Version` objects, by default only the most recent one, and calls the task that retrieves the Archives data with the version information - Saves the Archives JSON data as `VersionFile` objects ## `update_libraries` **Purpose**: Import and update `Library` and `Category` objects. Runs the library update script, which cycles through the repos listed in the Boost library and syncs their information. Most library information comes from `meta/libraries.json` stored in each Boost library repo. **Example** ```bash ./manage.py update_libraries ``` **Options** | Options | Format | Description | |----------------------|--------|--------------------------------------------------------------| | `--token` | string | GitHub API Token. If passed, will use this value. If not passed, will use the value in settings. | ## `import_library_versions` **Purpose**: Import and update `LibraryVersion` objects. **Example** ```bash ./manage.py import_library_versions ``` **Options** | Options | Format | Description | |----------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `--token` | string | GitHub API Token. If passed, will use this value. If not passed, will use the value in settings. | | `--release` | string | Format: `boost-1.63.0`. If passed, will import Artifactory urls for only that version. Partial versions are accepted (so "1.7" will import libraries for version 1.70.0, 1.71.0, etc.) | | `--new` | bool | Default: 'true'. If 'true', will import data for the newest release. Set to 'false' to import library version data for all releases | **Process** - Loops through `Version` objects based on passed-in options, by default just the most recent one. - For each `Version`, gets the libraries in that release from the `.gitmodules` file using the GitHub API - For each library listed in the `.gitmodules` file, get the complete list of libraries from the library's `meta/libraries.json` file (in its GitHub repo) using the GitHub API. (A single library repo might contain information for multiple libraries. Example: Functional also hosts Functional/Factory). - Save the `LibraryVersion` objects - Call the task to import documentation urls from data hosted in the S3 bucket ## `import_library_version_docs_urls` *This process is taken care of automatically as part of `import_library_versions`.* **Purpose**: Because of uniqueness in Boost library data, it's not possible to consistently format the URL for each Boost library-version. The current process involves hitting the url for the page in the Boost release notes that lists all the libraries and manually copying the URLs from the `