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
Bug 1883306: Include repo branch in URL for che icon #6764
Conversation
@rottencandy: This pull request references Bugzilla bug 1883306, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind bug |
/retest |
frontend/packages/dev-console/src/components/topology/topology-utils.ts
Outdated
Show resolved
Hide resolved
9d4b962
to
d356171
Compare
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.
Tested this locally with a server which could not start che, but the link looks good.
@saud I think when we do not have the |
d356171
to
169f79d
Compare
+1. Updated. |
return gitURL && cheURL ? `${cheURL}/f?url=${gitURL}&policies.create=peruser` : gitURL; | ||
export const getEditURL = (gitURL: string, gitBranch: string, cheURL: string) => { | ||
const fullGitURL = gitBranch ? `${gitURL}/tree/${gitBranch}` : gitURL; | ||
return cheURL ? `${cheURL}/f?url=${fullGitURL}&policies.create=peruser` : fullGitURL; |
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.
return cheURL ? `${cheURL}/f?url=${fullGitURL}&policies.create=peruser` : fullGitURL; | |
return gitURL && cheURL ? `${cheURL}/f?url=${fullGitURL}&policies.create=peruser` : fullGitURL; |
169f79d
to
1869edb
Compare
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.
/lgtm
/retest |
1 similar comment
/retest
|
@rottencandy you need to fix resource-utils.spec.ts specs. |
/lgtm cancel |
1869edb
to
a82b18f
Compare
const mockGitURL = | ||
mockResources.deploymentConfigs.data[0].metadata.annotations['app.openshift.io/vcs-uri']; | ||
const mockGitBranch = | ||
mockResources.deploymentConfigs.data[0].metadata.annotations['app.openshift.io/vcs-ref']; |
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.
Since you check if the branch is defined or not, can you please add add a second test when there is no branch defined.
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've added the check in the next it()
block.
const mockGitURL = | ||
mockResources.deploymentConfigs.data[0].metadata.annotations['app.openshift.io/vcs-uri']; | ||
const graphData = getTransformedTopologyData(mockResources, ['deploymentConfigs']); | ||
const { editURL, vcsURI } = graphData.nodes[0].data.data as WorkloadData; | ||
const editUrl = editURL || getEditURL(vcsURI, ''); | ||
const editUrl = editURL || getEditURL(vcsURI, '', ''); |
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.
const editUrl = editURL || getEditURL(vcsURI, '', ''); | |
const editUrl = getEditURL(vcsURI, '', ''); |
Please remove this "logic" from the test. Each test case should test a strict behavior and I expect that such a fallback is what we want "to test" here.
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.
Removed.
a82b18f
to
80f1982
Compare
Tested this locally and the link looks fine to me. @divyanshiGupta do you have something from keeping back adding a lgtm label? |
/lgtm |
/assign @christianvogt |
/bugzilla refresh Recalculating validity in case the underlying Bugzilla bug has changed. |
@openshift-bot: This pull request references Bugzilla bug 1883306, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve verified the changes, works as expected. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyanshiGupta, invincibleJai, jerolimov, rottencandy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/bugzilla refresh |
@rottencandy: This pull request references Bugzilla bug 1883306, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rottencandy: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
@rottencandy: All pull requests linked via external trackers have merged: Bugzilla bug 1883306 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherry-pick release-4.5 |
@rottencandy: #6764 failed to apply on top of branch "release-4.5":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rottencandy Cherry-picked this PR for 4.5. Happy holiday. |
Fixes:
https://issues.redhat.com/browse/ODC-4385
#6077
https://bugzilla.redhat.com/show_bug.cgi?id=1883306
Analysis / Root cause:
The URL generated for the Che editor icon in topology does not consider the repository branch.
Solution Description:
Include repository branch when creating the URL, in the format
${gitURL}/tree/${gitBranch}
.Test setup:
CheCluster
instance.Browser conformance: