Update documentation

This commit is contained in:
rubenwardy 2021-02-05 15:29:44 +00:00
parent 0918b8b676
commit 3ce653ba74
6 changed files with 95 additions and 23 deletions

@ -280,6 +280,9 @@ def update_config(package):
form.trigger.data = PackageUpdateTrigger.COMMIT
form.action.data = "notification"
if "trigger" in request.args:
form.trigger.data = PackageUpdateTrigger.get(request.args["trigger"])
if form.validate_on_submit():
if form.disable.data:
flash("Deleted update configuration", "success")

@ -46,10 +46,10 @@ Tokens can be attained by visiting [Settings > API Tokens](/user/tokens/).
* `title`: Human-readable title.
* `name`: Technical name (needs permission if already approved).
* `short_description`
* `tags`: List of tag names, see [misc](#misc).
* `content_warnings`: List of content warning names, see [misc](#misc).
* `license`: A license name.
* `media_license`: A license name.
* `tags`: List of [tag](#tags) names.
* `content_warnings`: List of [content warning](#content-warnings) names.
* `license`: A [license](#licenses) name.
* `media_license`: A [license](#licenses) name.
* `long_description`: Long markdown description.
* `repo`: Git repo URL.
* `website`: Website URL.
@ -187,7 +187,7 @@ curl -X POST https://content.minetest.net/api/packages/username/name/screenshots
## Topics
* GET `/api/topics/`: Supports [Package Queries](#package-queries), and the following two options:
* GET `/api/topics/` ([View](/api/topics/)): Supports [Package Queries](#package-queries), and the following two options:
* `show_added`: Show topics which exist as packages, default true.
* `show_discarded`: Show topics which have been marked as outdated, default false.
@ -206,19 +206,49 @@ Supported query parameters:
* `show_discarded`: Show topics marked as discarded.
* `limit`: Return at most `limit` topics.
## Types
## Misc
### Tags
* GET `/api/scores/`
* See [Package Queries](#package-queries)
* GET `/api/tags/`: List of:
* GET `/api/tags/` ([View](/api/tags/)): List of:
* `name`: technical name
* `title`: human-readable title
* `description`: tag description or null
* GET `/api/licenses/`: List of:
### Content Warnings
* GET `/api/content_warnings/` ([View](/api/content_warnings/)): List of:
* `name`: technical name
* `title`: human-readable title
* `description`: tag description or null
### Licenses
* GET `/api/licenses/` ([View](/api/licenses/)): List of:
* `name`
* `is_foss`: whether the license is foss
* GET `/api/homepage/`
### Minetest Versions
* GET `/api/minetest_versions/` ([View](/api/minetest_versions/))
* `name`: Version name.
* `is_dev`: boolean, is dev version.
* `protocol_version`: protocol version umber.
## Misc
* GET `/api/scores/` ([View](/api/scores/))
* See [Top Packages Algorithm](/help/top_packages/).
* Supports [Package Queries](#package-queries).
* Returns list of:
* `author`: package author name.
* `name`: package technical name.
* `downloads`: number of downloads.
* `score`: total package score.
* `score_reviews`: score from reviews.
* `score_downloads`: score from downloads.
* GET `/api/homepage/` ([View](/api/homepage/)) - get contents of homepage.
* `count`: number of packages
* `downloads`: get number of downloads
* `new`: new packages
@ -227,4 +257,3 @@ Supported query parameters:
* `pop_txp`: popular textures
* `pop_game`: popular games
* `high_reviewed`: highest reviewed
* GET `/api/minetest_versions/`

@ -20,6 +20,11 @@ The process is as follows:
3. The git host posts a webhook notification to ContentDB, using the API token assigned to it.
4. ContentDB checks the API token and issues a new release.
<p class="alert alert-warning">
"New commit" or "push" based webhooks are currently broken as they don't check the branch name.
This means that releases will be created for pushes to non-default branches.
</p>
## Setting up
### GitHub
@ -49,9 +54,10 @@ The process is as follows:
choose "Tag push events".
8. Add webhook.
## Configuring
## Configuring Release Creation
See the [Package Configuration and Releases Guide](/help/package_config/) for
documentation on configuring the release creation.
You can set the min/max Minetest version from the Git repository, and also
configure what files are included.
From the Git repository, you can set the min/max Minetest versions, which files are included,
and update the package meta.

@ -502,9 +502,9 @@ class Package(db.Model):
return url_for("packages.bulk_change_release",
author=self.author.username, name=self.name)
def getUpdateConfigURL(self, action=None):
def getUpdateConfigURL(self, trigger=None, action=None):
return url_for("packages.update_config",
author=self.author.username, name=self.name, action=action)
author=self.author.username, name=self.name, trigger=trigger, action=action)
def getSetupReleasesURL(self):
return url_for("packages.setup_releases",

@ -29,6 +29,14 @@
{{ _("Have you read the Package Inclusion Policy and Guidance yet?") }}
</div>
{% if package %}
<div class="alert alert-secondary">
<a class="float-right btn btn-sm btn-default" href="/help/package_config/#cdbjson">{{ _("Read more") }}</a>
{{ _("You can include a .cdb.json file in your %(type)s to update these details automatically.", type=package.type.value.lower()) }}
</div>
{% endif %}
{% if package and package.checkPerm(current_user, "REIMPORT_META") and package.releases.first() %}
<form class="alert alert-secondary mb-5" method="post" action="{{ package.getUpdateFromReleaseURL() }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />

@ -5,6 +5,9 @@
{% endblock %}
{% block content %}
<a class="btn btn-secondary float-right" href="{{ package.getDetailsURL() }}">
{{ _("Later") }}
</a>
<h1>{{ self.title() }}</h1>
<p>
@ -22,12 +25,35 @@
{{ _("This can be changed later.") }}
</p>
<p class="mt-5">
<a class="btn btn-primary" href="{{ package.getUpdateConfigURL() }}">Automatically</a>
<a class="btn btn-secondary ml-2" href="{{ package.getUpdateConfigURL(action="notification") }}">Manually, enable reminders</a>
<a class="btn btn-secondary ml-2" href="{{ package.getCreateReleaseURL() }}">Manually, no reminders</a>
<a class="btn btn-secondary ml-2" href="{{ package.getDetailsURL() }}">Later</a>
</p>
<div class="row">
<div class="col-md-6 mt-5">
<h3 class="mt-0">{{ _("Automatically (Recommended)") }}</h3>
<p>
<a class="btn btn-primary" href="{{ package.getUpdateConfigURL(trigger="commit") }}">
{{ _("Rolling Release") }}
</a>
<a class="btn btn-primary ml-2" href="{{ package.getUpdateConfigURL(trigger="tag") }}">
{{ _("On Git Tag") }}
</a>
{# <a class="btn btn-secondary ml-2" href="{{ package.getUpdateConfigURL() }}">#}
{# {{ _("Advanced") }}#}
{# </a>#}
</p>
</div>
<div class="col-md-6 mt-5">
<h3 class="mt-0">{{ _("Manually") }}</h3>
<p>
<a class="btn btn-secondary" href="{{ package.getUpdateConfigURL(action="notification") }}">
{{ _("With reminders") }}
</a>
<a class="btn btn-secondary ml-2" href="{{ package.getCreateReleaseURL() }}">
{{ _("No reminders") }}
</a>
</p>
</div>
</div>
{% else %}
<p>
{{ _("Using Git would allow you to create releases automatically when you push code or tags.") }}