Remove deprecated API paths (#2639)

This commit is contained in:
qwerty287 2023-10-24 15:21:05 +02:00 committed by GitHub
parent c344cbb0fc
commit 5045f1e431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 57 deletions

View file

@ -743,45 +743,6 @@ const docTemplate = `{
}
}
},
"/logs/{repo_id}/{pipeline}/{stepID}": {
"get": {
"produces": [
"text/plain"
],
"tags": [
"Pipeline logs"
],
"summary": "Log stream",
"parameters": [
{
"type": "integer",
"description": "the repository id",
"name": "repo_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "the number of the pipeline",
"name": "pipeline",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "the step id",
"name": "stepID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/org/lookup/{org_full_name}": {
"get": {
"produces": [
@ -1968,7 +1929,7 @@ const docTemplate = `{
}
},
"/repos/{repo_id}/logs/{number}": {
"post": {
"delete": {
"produces": [
"text/plain"
],
@ -3274,6 +3235,62 @@ const docTemplate = `{
}
}
},
"/stream/events": {
"get": {
"description": "event source streaming for compatibility with quic and http2",
"produces": [
"text/plain"
],
"tags": [
"Events"
],
"summary": "Event stream",
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/stream/logs/{repo_id}/{pipeline}/{stepID}": {
"get": {
"produces": [
"text/plain"
],
"tags": [
"Pipeline logs"
],
"summary": "Log stream",
"parameters": [
{
"type": "integer",
"description": "the repository id",
"name": "repo_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "the number of the pipeline",
"name": "pipeline",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "the step id",
"name": "stepID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/user": {
"get": {
"produces": [

View file

@ -10,11 +10,12 @@ Some versions need some changes to the server configuration or the pipeline conf
- Deprecated `platform:` filter in favor of `labels:`, [read more](./20-usage/20-workflow-syntax.md#filter-by-platform)
- Removed `build` alias for `pipeline` command in CLI
- Removed `ssh` backend. Use an agent directly on the SSH machine using the `local` backend.
- Removed `/hook` and `/stream` API paths in favor of `/api/(hook|stream)`. You may need to use the "Repair repository" button in the repo settings or "Repair all" in the admin settings to recreate the forge hook.
## 1.0.0
- The signature used to verify extensions calls (like those used for the [config-extension](./30-administration/100-external-configuration-api.md)) done by the Woodpecker server switched from using a shared-secret HMac to an ed25519 key-pair. Read more about it at the [config-extensions](./30-administration/100-external-configuration-api.md) documentation.
- Refactored support of old agent filter labels and expression. Learn how to use the new [filter](./20-usage/20-workflow-syntax.md#labels)
- The signature used to verify extension calls (like those used for the [config-extension](./30-administration/100-external-configuration-api.md)) done by the Woodpecker server switched from using a shared-secret HMac to an ed25519 key-pair. Read more about it at the [config-extensions](./30-administration/100-external-configuration-api.md) documentation.
- Refactored support for old agent filter labels and expressions. Learn how to use the new [filter](./20-usage/20-workflow-syntax.md#labels)
- Renamed step environment variable `CI_SYSTEM_ARCH` to `CI_SYSTEM_PLATFORM`. Same applies for the cli exec variable.
- Renamed environment variables `CI_BUILD_*` and `CI_PREV_BUILD_*` to `CI_PIPELINE_*` and `CI_PREV_PIPELINE_*`, old ones are still available but deprecated
- Renamed environment variables `CI_JOB_*` to `CI_STEP_*`, old ones are still available but deprecated

View file

@ -453,7 +453,7 @@ func PostPipeline(c *gin.Context) {
// DeletePipelineLogs
//
// @Summary Deletes log
// @Router /repos/{repo_id}/logs/{number} [post]
// @Router /repos/{repo_id}/logs/{number} [delete]
// @Produce plain
// @Success 204
// @Tags Pipeline logs

View file

@ -34,10 +34,14 @@ import (
"github.com/woodpecker-ci/woodpecker/server/store"
)
// EventStreamSSE
//
// event source streaming for compatibility with quic and http2
//
// @Summary Event stream
// @Description event source streaming for compatibility with quic and http2
// @Router /stream/events [get]
// @Produce plain
// @Success 200
// @Tags Events
func EventStreamSSE(c *gin.Context) {
c.Header("Content-Type", "text/event-stream")
c.Header("Cache-Control", "no-cache")
@ -118,10 +122,10 @@ func EventStreamSSE(c *gin.Context) {
}
}
// LogStream
// LogStreamSSE
//
// @Summary Log stream
// @Router /logs/{repo_id}/{pipeline}/{stepID} [get]
// @Router /stream/logs/{repo_id}/{pipeline}/{stepID} [get]
// @Produce plain
// @Success 200
// @Tags Pipeline logs

View file

@ -224,13 +224,4 @@ func apiRoutes(e *gin.RouterGroup) {
}
}
}
// TODO: remove /hook in favor of /api/hook
e.POST("/hook", api.PostHook)
// TODO: move to /api/stream
sse := e.Group("/stream")
{
sse.GET("/events", api.EventStreamSSE)
}
}