Skip to content

Support human readable project name#7357

Merged
klesh merged 3 commits into
mainfrom
kw-7217-project-name
Apr 22, 2024
Merged

Support human readable project name#7357
klesh merged 3 commits into
mainfrom
kw-7217-project-name

Conversation

@klesh
Copy link
Copy Markdown
Contributor

@klesh klesh commented Apr 22, 2024

Summary

Apache DevLake does not support special characters in Project names properly, lets solve it once and for all.

The solution is simple: Whenever calling an API with projectName in the path, i.e. GET /projects/:projectName, it must be encodeURIComponent.

There are 4 API endpoints:

	r.GET("/projects/:projectName", project.GetProject)
	r.GET("/projects/:projectName/check", project.GetProjectCheck)
	r.PATCH("/projects/:projectName", project.PatchProject)
	r.DELETE("/projects/:projectName", project.DeleteProject)

Does this close any open issues?

BE Part for #7217
related discussion: e9c2579

Screenshots

The get detail API

curl http://localhost:4000/api/projects/hello%20%2F%20world
{"name":"hello / world","description":"","createdAt":"2024-04-22T14:42:51.814+08:00","updatedAt":"2024-04-22T14:42:51.814+08:00","_raw_data_params":"","_raw_data_table":"","_raw_data_id":0,"_raw_data_remark":"","metrics":null,"blueprint":null}

The check existing API

curl http://localhost:4000/api/projects/hello%20%2F%20world/check
{"exist":true}

klesh referenced this pull request Apr 22, 2024
* feat: add project exist check

* fix: swagger doc
@klesh klesh merged commit d571e97 into main Apr 22, 2024
@klesh klesh deleted the kw-7217-project-name branch April 22, 2024 07:51
@klesh klesh mentioned this pull request Mar 25, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants