You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Took me a little longer, since i noticed that my initial idea would
literally have required a full refactor, which was a little too large in
scope. the above checklist is for keeping track of what will be added
and this PR is here to track the progress and eventual questions.
closes#743
## Plans
- [x] Extending the configuration format and adding a `[gitea]` section
- [x] Allowing to generate the configuration from known gitea remotes
- [x] using gitea on the `CreatePullRequest` step
- [x] using gitea on the `Release` step
- [x] creating a new step `SelectGiteaIssue`
- [x] adding a new `forge` concept to the documentation to link forge
integrations together in a convenient place
- [x] adding a new `gitea` section to the config file reference
- [x] multi-forge support as mentioned in
#743 (comment)
## Testing
- PR generated by knope on a copy of one of the projects i work on.
(fixes will be pushed in a bit)
https://codeberg.org/FallenValkyrie/testing/pulls/5
- generated release
https://codeberg.org/FallenValkyrie/testing/releases/tag/v0.3.0
- Adding tests in `tests::gitea_release` and `tests::generate`
- selecting gitea issues (token has already been deleted, so no need to
censor it)

- Using the same testing repo to see if knope correctly asks for the
`GITEA_TOKEN`

## Notes
- Commits will be reorganized after review. This is simply because i
don't feel like constantly reorganizing commits.
- The PR looks huge, but most of that is tests and test assets.
- Currently `ureq` (as far as i can tell) doesn't support sending
multipart form data and the only library i could find,
[`ureq_multipart`](https://docs.rs/ureq_multipart/latest/ureq_multipart/index.html),
panics on IO errors and has messages in chinese (see [in its own
codebase](https://gitee.com/eshangrao/ureq-multipart-toolkit/blob/master/src/lib.rs#L186-196)).
Together i find those unacceptable design choices. issue:
algesten/ureq#698
---------
Co-authored-by: Dylan Anthony <[email protected]>
Copy file name to clipboardexpand all lines: docs/src/content/docs/reference/Config File/Steps/create-pull-request.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,16 @@
2
2
title: CreatePullRequest
3
3
---
4
4
5
-
Create a pull request on GitHub from the current branch to a specified branch. If a pull request for those already exists, this step will overwrite the title and body of the existing pull request.
5
+
Create a pull request on every configured forge from the current branch to a specified branch. If a pull request for those already exists, this step will overwrite the title and body of the existing pull request.
6
+
7
+
:::caution
8
+
If you configure more than one forge, Knope will assume that you wish to create a PR on all of them.
9
+
Keep that in mind, when writing your configuration.
10
+
:::
11
+
12
+
## Prerequisites
13
+
14
+
To use the `CreatePullRequest` step, you must configure a forge first. See [configuring a Forge] for more information.
6
15
7
16
## Parameters
8
17
@@ -52,3 +61,4 @@ For a full example of how to use this with GitHub Actions to help automate relea
Copy file name to clipboardexpand all lines: docs/src/content/docs/reference/Config File/Steps/release.md
+16-11
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@ title: Release
3
3
---
4
4
5
5
Release the configured [packages] which have pending changes.
6
-
If there is a [GitHub config] set,
7
-
this creates a release on GitHub with the same release notes that it added to the changelog (if any).
6
+
If there is a [forge config] set,
7
+
this creates a release with the same release notes that it added to the changelog (if any).
8
8
Otherwise, this tags the current commit as a release.
9
9
In either case, this step adds a new Git tag with the package's tag format.
10
10
You should run [`PrepareRelease`] before this step, though not necessarily in the same workflow.
@@ -21,15 +21,15 @@ If the config file is using the `[packages.{name}]` syntax,
21
21
each package gets its own tag in the format `{name}/v{version}` (this is the syntax required for Go modules).
22
22
See examples below for more illustration.
23
23
24
-
## GitHub release notes
24
+
## Release notes
25
25
26
26
There are several different possible release notes formats:
27
27
28
28
1. If run after a [`PrepareRelease`] step in the same workflow, the release notes will be the same as the changelog section created by [`PrepareRelease`] even if there is no changelog file configured—with the exception that headers are one level higher (for example, `####` becomes `###`).
29
29
2. If run in a workflow with no [`PrepareRelease`] step before it (the new version was set another way), and there is a changelog file for the package, the release notes will be taken from the relevant changelog section. This section header must match exactly what [`PrepareRelease`] would have created. Headers will one level higher (for example, `####` becomes `###`).
30
-
3. If run in a workflow with no [`PrepareRelease`] step before it (the new version was set another way), and there is no changelog file for the package, the step will use GitHub's automatic release notes generation.
30
+
3. If run in a workflow with no [`PrepareRelease`] step before it (the new version was set another way), and there is no changelog file for the package, the step will use automatic release notes generation.
31
31
32
-
## GitHub release assets
32
+
## Release assets
33
33
34
34
You can optionally include any number of assets to include in a release via [package assets].
35
35
If you do this, this step will:
@@ -42,15 +42,20 @@ If you have any follow-up workflows triggered by GitHub releases,
42
42
you can use `on: release: created` to run as soon as the step creates the draft
43
43
(without assets) or `on: release: published` to run only after the assets are uploaded.
44
44
45
+
:::caution
46
+
[Package assets] are currently unsupported when used together with Gitea.
47
+
This is due to one of Knope's dependencies not supporting `multipart/form-data` requests.
48
+
:::
49
+
45
50
## Errors
46
51
47
52
This step will fail if:
48
53
49
-
1.[GitHub config] exists but Knope can't create a release on GitHub. For example:
50
-
1. There is no GitHub token set.
51
-
2. The GitHub token doesn't have permission to create releases.
52
-
3. The release already exists on GitHub (causing a conflict).
53
-
2. There is no [GitHub config] set and Knope can't tag the current commit as a release.
54
+
1.[forge config] exists but Knope can't create a release on the forge. For example:
55
+
1. There is no token set.
56
+
2. The token doesn't have permission to create releases.
57
+
3. The release already exists on the forge (causing a conflict).
58
+
2. There is no [forge config] set and Knope can't tag the current commit as a release.
54
59
3. Could not find the correct changelog section in the configured changelog file for loading release notes.
55
60
4. One of the configured package assets doesn't exist.
56
61
@@ -179,7 +184,7 @@ See [Knope's release workflow] and [knope.toml] where we:
179
184
3. Fan out into several jobs which each check out the changes and build a different binary
180
185
4. Create a GitHub release with the new version, changelog, and the binary assets
0 commit comments