-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new section named development in issue view sidebar to interact with branch/pr #31899
base: main
Are you sure you want to change the base?
Conversation
The logic is derived from all other forms. All other forms have the same behaviour to avoid user losing their content accidentally.
|
Fixed in f2a28d0 |
This comment was marked as resolved.
This comment was marked as resolved.
|
IssueID int64 `xorm:"INDEX"` | ||
LinkType IssueDevLinkType | ||
LinkedRepoID int64 `xorm:"INDEX"` // it can link to self repo or other repo | ||
LinkIndex string // branch name, pull request number or commit sha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have branch table, so this can be int64?
ps: Commit SHA seems meaningless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future PRs, we can link a commit to this issue. So it will be kept to support that. BTW: Azure supports linking to a commit. I think for some development model, they just push commits with no feature branches or pull requests, they can use this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it can be split into to columns. LinkIndex
(int64) and LinkRef
(string)?
Using string
type means you need to convert it from/to int64
type every time if it is a PR ID or branch ID which seems not good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it can be split into to columns.
LinkIndex
(int64) andLinkRef
(string)? Usingstring
type means you need to convert it from/toint64
type every time if it is a PR ID or branch ID which seems not good.
The conversion is on the memory and we don't know what data we will store according to different LinkType. And this column will never be used as index, so we don't need to consider performance or as search condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also agree it doesn't seem to be a good name or proper design. There are already too many "index" in code: search index, database index, issue index, etc.
And using "string" to store "int" in database would cause problems, if you write ("where str_field = ?", intVal)
, then it can't use the index and would cause imperceptible performance problems.
This section should be hidden or disabled when repo is empty or repo is archive or repo is mirror. |
The links are still useable. Only |
type IssueDevLinkType int | ||
|
||
const ( | ||
IssueDevLinkTypeBranch IssueDevLinkType = iota + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried to play with GitHub's development sidebar for a while. I can see there could be a lot of edge cases:
- create a new branch
123-my-issue
, rename the branch to123-my-issue-other
, the link disappears, rename another branch to123-my-issue
, the link won't appear again. - create a new branch
123-my-issue
, create a PR from123-my-issue
, then the link is updated to PR, the branch link is replaced.
I believe these details need enough documents(comments) and tests.
I guess it won't catch 1.23 milestone since this PR doesn't seem to be complete enough.
And using "string" to store "int" in database would cause problems, if you write Just tried to play with GitHub's development sidebar for a while. I can see there could be a lot of edge cases:
I believe these details need enough documents(comments) and tests. |
Partially Resolve #20226
This PR add a new section on the sidebar of issue named
Development
. It supports creating one or multiple branches and pull requests from the sidebar.No related branch or PR
Create new branch from the issue
Prefill title and content when creating pull request from the issue development link
Realted PR created
Related PR merged
Mayge fixed near the issue title
TODO: