Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated API paths #2639

Merged
merged 6 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 57 additions & 40 deletions cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -1942,7 +1903,7 @@ const docTemplate = `{
}
},
"/repos/{repo_id}/logs/{number}": {
"post": {
"delete": {
"produces": [
"text/plain"
],
Expand Down Expand Up @@ -3248,6 +3209,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": [
Expand Down
5 changes: 3 additions & 2 deletions docs/docs/91-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 to recreate the forge hook.
qwerty287 marked this conversation as resolved.
Show resolved Hide resolved

## 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
Expand Down
2 changes: 1 addition & 1 deletion server/api/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions server/api/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions server/router/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,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)
}
}