Implementing Tencent Gongfeng Project Search with Alfred
At work, I often need to search repository code on Gongfeng and quickly perform certain operations. Doing multiple operations directly in the browser is still not efficient enough, so I created a workflow. The general effect is like
GitHub for Alfred
.
Implementation Foundation
Gongfeng provides APIs, such as fuzzy project search, so keyword-based project search functionality can be implemented. For specific APIs, refer to here
By applying for an access token for the corresponding account, you can directly call the API to get results. I verified this works using Mac Paw.
Implementation
Using the CLI I developed earlier, this was implemented quickly. Since daily work involves accessing multiple Gongfeng services [intranet version, community version, etc.], the workflow supports multiple Gongfeng service configurations.
Currently supports searching up to 2 Gongfeng services. The principle is the same - just concurrent requests to 2 addresses. If you want to support more in the future, just increase the number of parallel request addresses.
Usage
Access Gongfeng service, such as https://git.code.tencent.com/profile/account, click
Create temporary token
Configure the token and git address in the workflow environment variables
In addition to search functionality, the workflow also provides commonly used features:
- gc + keyword for fuzzy search
⌘ C
directly copy repo’s web address⏎
browser access to repo’s web address⌘ ⏎
copy SSH repo address⌥ ⏎
select MR, then⌥ ⏎
shows repo’s open Merge Requests, also supports keyword search
Overall design: ⏎
opens corresponding URLs in browser, ⌥
for further operations.
Final Thoughts
- With this workflow, accessing repos starts with search first, then Enter to access specific repos, which is more convenient than before.