Skip to content

feat(package): Support PHP composer dev-* branch - #38563

Open
douyun-dtyq wants to merge 6 commits into
go-gitea:mainfrom
douyun-dtyq:dev-branch/v2
Open

feat(package): Support PHP composer dev-* branch#38563
douyun-dtyq wants to merge 6 commits into
go-gitea:mainfrom
douyun-dtyq:dev-branch/v2

Conversation

@douyun-dtyq

Copy link
Copy Markdown

Users can POST to /packages/{owner}/composer/{vendor}/{project}/-/composer/dev-branch to create a dev-<branchname> version as a virtual version to link to branch (or other refs) archive zips. The behavior matches Packagist.

Also set composer SemverCompatible to false to support this.

Needs a migration like UPDATE package SET semver_compatible = false WHERE "type" = 'composer'; for the SemverCompatible change. But I'm not sure how to create a migration commit for this project, so it's currently missing. Guidance on this would be appreciated!

Code was written by GitHub Copilot with GPT5.5, but all changes have been thoroughly reviewed and tested by myself (both newly added unit tests and on a real instance). I take full responsibility for the code.

Discussions:

  1. SemverCompatible seems not very useful for the package model and is often just a cumbersome burden. In my opinion, trying to parse the version string and silently failing is better than static SemverCompatible control for packages.
  2. For dev-* versions: should we allow out-of-scope repositories (like the package is at someorg, but the dev-master links to the master branch of anotherorg/somerepo) or even external links?
  3. The API path is not exposed to Swagger (due to it being at /packages, not /v1/packages) and WebUI (since current composer package workflow is API only). Maybe we can add a simple switch on the WebUI for this feature?
  4. Property, struct, API path, and helper naming or placement may not fully match the project conventions. Feel free to suggest any changes.

BTW: should we alias/link/mount /packages routes to /v1/packages to show it in swagger?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 21, 2026
@github-actions github-actions Bot added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jul 21, 2026
User can POST to
/packages/{owner}/composer/{vendor}/{project}/-/composer/dev-branch to
create a dev-<branchname> version as a virtual version to link to
branch (or other refs) archive zips. The behavior should match
packagist.

Also set composer SemverCompatible to false to support this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants