Comments (9)
ahh, ok, looks like we should add a field called "branch_slug" that removes any characters that aren't URL friendly. We already have a helper function for this:
https://github.com/drone/drone/blob/master/pkg/model/util.go#L34
Off the top of my head, we'll need to:
- add BranchSlug to the Commit struct
- add the database column and index it
- alter any sql queries that use
branch
to usebranch_slug
- alter any templates that use
branch
when constructing the URL and switch tobranch_slug
- alter the badge template and badge code to use
branch_slug
from gitness.
ahh, ok, looks like we should add a field called "branch_slug" that removes any characters that aren't URL friendly.
I would use the branch HEAD SHA1 rather than generate a "not-so friendly" slug
from gitness.
We let you filter your build history in the UI based on branch. The URL pattern follows a similar convention to GitHub: /github.com/:owner/:name/tree/:branch
Drone: https://localhost:8080/github.com/drone/drone/tree/master
GitHub: https://github.com/drone/drone/tree/master
I haven't looked, but I'm guessing GitHub strips non-friendly URL characters out of its branches as well?
from gitness.
I haven't looked, but I'm guessing GitHub strips non-friendly URL characters out of its branches as well?
- slash chars are not stripped at least: https://github.com/nvie/gitflow/tree/feature/implement-hooks
- branch sha1 is also valid on GH: https://github.com/drone/drone/tree/088c45941cc3105ef0f400c4455dd816525b2a81
from gitness.
ok, thanks for that info!
for now, we can just escape the branch value in our template:
{{ .Branch | html }}
this should get things working without having to commit to a specific approach just yet. I'm working on a patch now.
from gitness.
Great! also according to pat documentation:
replacing:
m.Get("/:host/:owner/:name/tree/:branch", handler.RepoHandler(handler.RepoDashboard))
with:
m.Get("/:host/:owner/:name/tree/:branch/", handler.RepoHandler(handler.RepoDashboard))
should make it work too
from gitness.
I wasn't able to get the pat route to work with the trailing slash :(
So for now we're using url query parameters. I'm not in the love with the approach, but at least it makes the system usable. feel free to pull the latest .deb
to upgrade
from gitness.
Hey @bradrydzewski I think this is an issue in the 0.3 branch. If we uses /'s the UI doesn't work properly but if we use _ instead it appears.
from gitness.
Yes, I changed how we handle branches from 0.2 to 0.3 we'll need to update our server-side routes to use regular expressions to accomodate slashes /v1/api/repos/{host}/{owner}/{name}/branches/{branch:(.+)}
from gitness.
Related Issues (20)
- Feature request of running a build on a seperated node
- Drone use PAT owner account for git commit HOT 1
- Cannot use expression variables in pipeline HOT 2
- feat: is it possible to recreate frontend(web) with nextjs? HOT 1
- The pipelines are unable to function properly when reading secrets. HOT 1
- any plan to release public cloud hosting? HOT 1
- Deploying Code on Different Runners based on Branches in Drone CI/CD HOT 1
- Helm chart missing index file HOT 1
- Opensource Website? HOT 1
- Git HTTPS Protocol - New Branch Creation Rule Not Blocking Push from CLI but Works via UI HOT 2
- Project and repo deletion actually do not delete the db spaces + repos, and do not free disk space HOT 1
- Pipeline Only Mode HOT 1
- Bug: Improve public repositories experience when visited HOT 1
- Feature request: explore tab
- Using drone is a real pain
- Gitness Integration with Open Source Dev Environment Manager. HOT 2
- Gitness Integration support HOT 1
- Gitness Api HOT 3
- Error: Changes blocked by files exceeding the file size limit HOT 2
- using pipelines with Docker-in-Docker samples, Error: mount: permission denied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitness.