Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(WIP)
tag to today's date inCHANGELOG.md
release
label to this PRBig update! Now includes implementation for the following RFCs:
Changes
BREAKING: Changed module path from
github.com/iver-wharf/wharf-api
togithub.com/iver-wharf/wharf-api/v5
. (Appended /v5 to Go module #128)BREAKING: Removed all deprecated environment variable configs, which were marked as deprecated in v4.2.0/Added wharf-core configs #38. Now all environment variables require the
WHARF_
prefix. (Removed unused config environment variable mappings #87)BREAKING: Changed the following POST creation endpoints to solely create, instead of the previous behavior where it instead could update if it found an existing database object that matched the HTTP request data: (Fix post/put behavior #88, Fixed fetchDatabaseObjByID util func #93)
POST /project
POST /provider
POST /token
BREAKING: Removed RabbitMQ integration. All
mq.*
YAML configs andWHARF_MQ_*
environment variables are no longer relevant. This may be implemented again later, but inside a new "notification" component instead of directly inside wharf-api. (Removed RabbitMQ integration #102)Deprecated PUT endpoints that took the object ID from the HTTP request body. They are still supported, but may be removed in the next major release (v6.0.0). Please refer to the new endpoints that takes the ID from the URL path. (Fix post/put behavior #88, PUT /branches rework #91, Fixed endpoint IDs of deprecated endpoints #94, Added swaggo docs param projectId to updateProjectHandler #97, Added missing PUT /branches endpoint registration #113)
PUT /project/{projectId}
instead ofPUT /project
PUT /provider/{providerId}
instead ofPUT /provider
PUT /token/{tokenId}
instead ofPUT /token
PUT /project/{projectId}/branch
instead ofPUT /branches
Deprecated POST search endpoints that took the search queries from the HTTP request body. They are still supported, but may be removed in the next major release (v6.0.0). Please refer to the new endpoints that use query parameter instead. (Search via
GET /project
#99, Added remaining GET search endpoints #109, Paginated response fixes #118, Fixed PaginatedBuilds in deprecated getProjectBuildListHandler #119, Fixed GET /project using providerJSONToColumns #123)GET /project
instead ofGET /projects
orPOST /projects/search
GET /build
instead ofGET /projects/{projectId}/builds
orPOST /builds/search
GET /provider
instead ofGET /providers
orPOST /providers/search
GET /token
instead ofGET /tokens
orPOST /tokens/search
GET /build/{buildId}/artifact
instead ofGET /build/{buildId}/artifacts
Deprecated
/branch
and/branches
endpoints in favor of new/project/{projectId}/branch
endpoints. (Move endpoints #120, Implemented endpoints from #120 #121)Deprecated
PUT /build/{buildId}
in favor of newPUT /build/{buildId}/status
endpoint. (Move endpoints #120, Implemented endpoints from #120 #121)Deprecated
POST /project/{projectId}/{stage}/run
in favor of newPOST /project/{projectId}/build
endpoint. (Move endpoints #120, Implemented endpoints from #120 #121)Added new GET endpoints to get list of objects (as mentioned in note above), with large set of query parameters. Major difference with their "plural" GET counterparts, they all return paginated results instead, as well as a
"totalCount"
field for the overall query.By default all these new endpoints use a default limit of 100, but this can be disabled by specifying
?limit=0
. (Added remaining GET search endpoints #109, Paginated response fixes #118)Added configuration of specific origins for CORS via the environment variable
WHARF_HTTP_CORS_ALLOWORIGINS
or the YAML keyhttp.cors.allowOrigins
. This is to make sendingAuthorization
headers possible. (Allow cred/authorization header CORS #101)Added a slew of options for setting OIDC parameters (see WHARF_HTTP_OIDC_*) for JWT token verification. Upon setting
WHARF_HTTP_OIDC_ENABLE=true
a check will be enforced for requests sent to the api such that all requests not carrying a valid bearer token will fail.Added support for Sqlite. Default database driver is still Postgres.
Note: wharf-api must be compiled with
CGO_ENABLED=1
(which is the default for Go builds) but our Docker build is compiled withCGO_ENABLED=0
. If you need Sqlite support in our Docker image, then please file a new issue over at https://github.com/iver-wharf/wharf-api/issues/new, and we will take a look at it. (Added support for Sqlite #86)Added configuration for selecting database driver, environment variable
WHARF_DB_DRIVER
or the YAML keydb.driver
. Valid values: (Added support for Sqlite #86)postgres
(default)sqlite
Added configuration for Sqlite file path, environment variable
WHARF_DB_PATH
or the YAML keydb.path
. Defaults towharf-api.db
. (Added support for Sqlite #86)Added dependency on
gorm.io/driver/sqlite
. (Added support for Sqlite #86)Added
updatedAt
andcreatedAt
fields to the following models: (Added CreatedAt and UpdatedAt #111)response.Artifact
response.Branch
response.Build
response.Project
response.Provider
response.TestResultDetail
response.TestResultSummary
response.Token
Objects created and updated before this patch will have the value
null
, but will get a valid date on first update, such as on first refresh for a project.Fixed bug where unable to delete a Project without first deleting all child objects. (Fixed cannot delete projects #64)
Fixed where wharf-core logging for Gin debug and error messages were set up after they were initially used, leading to a mix of wharf-core and Gin formatted logs. (Fixed so gin logger intration is setup before it's used #63)
Added database tables: (Reworked handling of test results #43)
Added test-result specific endpoints: (Reworked handling of test results #43, Paginated response fixes #118)
POST /build/{buildid}/test-result
This should be used instead of
POST /build/{buildid}/artifact
when uploading test result files.GET /build/{buildid}/test-result/detail
GET /build/{buildid}/test-result/summary
GET /build/{buildid}/test-result/summary/{artifactId}
GET /build/{buildid}/test-result/summary/{artifactId}/detail
GET /build/{buildid}/test-result/list-summary
Deprecated endpoint
GET /build/{buildid}/tests-results
.Use
GET /build/{buildid}/test-result/list-summary
instead. The response data is slightly different; it has additional properties, and does not have astatus
property. (Reworked handling of test results #43, Fixed some things missed in PR #43 #77, Paginated response fixes #118)Changed format of all endpoint's path parameters from all lowercase to camelCase: (Changed path params to camelCase #76)
This affects the Swagger documentation, but has no behavioral implications.
Deprecated endpoint
GET /branch/{branchId}
. Getting a single branch by its ID has not been shown to have any benefits. Please refer to theGET /project/{projectId}
endpoint instead. (Deprecated GET /branch/{branchid} #75)Removed
Provider.UploadURL
and all references to it, as it was unused. (Removed Provider.UploadURL #82)Removed DB column
provider.upload_url
, as it was unused. (Removed Provider.UploadURL #82)Added
TestResultListSummary
field toBuild
database model. This allows you to avoidN+1
HTTP requests when listing builds to show test summaries. (Fixed N+1 Build and TestResult fetch issue #80)Changed to preload
TestResultSummaries
field ofBuild
database model. (Fixed N+1 Build and TestResult fetch issue #80)Added packages for "Plain Old Go Objects", with finer-grained decoupling between database, HTTP request, and HTTP response models. The Swagger documentation is affected by this, and some unused fields have been removed from certain endpoints, such as the
tokenId
inPOST /token
. The new packages are: (Split up DB models: part 1 #78, Split rest of models #83)pkg/model/database
pkg/model/request
pkg/model/response
Added more backend validation on some endpoints, such as enforcing
name
field to be set when creating a new project. (Split rest of models #83)Fixed
PUT /token
where it did not use theproviderId
value from the HTTP request body. It now sets the provider's token if the field is supplied and non-zero. (Split up DB models: part 1 #78)Added Swagger operation IDs to all endpoints. This has no effect on the API's behavior, but affects code generators. (Added swaggo operation ID & renamed handlers #79)
Fixed bug where projects created using the deprecated
PUT /project
endpoint would have set a nullProviderID
in the database. (Fixed dbNewProject.ProviderID being set to request's ProjectID #96)Added Swagger attribute
minimum
to all ID path parameters, response bodies, and request bodies, as we do not support negative values there. (Improved swagger docs for ID params #98)Changed a lot of database columns to be
NOT NULL
where wharf-api already didn't support null/nil values. Migration steps have been added so any potential null values will be changed to empty strings or zeroes. The updated columns are: (Migrate columns toNOT NULL
#100)artifact.file_name
build_param.value
param.default_value
param.value
project.avatar_url
project.build_definition
project.description
project.git_url
project.group_name
test_result_summary.file_name
token.user_name
Added new field
RemoteProjectID
to the project model. (Added RemoteProjectID to Project structs #112)Added endpoints to allow setting manual overrides for a project. These overrides are used in responses from
GET /project
and other, as well as in build parameters for newly started builds. New endpoints: (Project overrides #117, Fixed foreign key constraint #127)GET /project/{projectId}/override
to get all overridesPUT /project/{projectId}/override
to set all overridesDELETE /project/{projectId}/override
to clear all overridesChanged version of
github.com/iver-wharf/wharf-core
from v1.2.0 to v1.3.0. (Updated to wharf-core v1.3.0 #125)Changed Dockerfile for easier windows building. (Fix windows docker build #126)
Actions after merge
Follow the step-by-step guide found here:
https://iver-wharf.github.io/#/development/releasing-a-new-version?id=merging-a-release-pr