-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 Git Panel #7235
Add Git Panel #7235
Conversation
CHE-6361: Add git panel prototype
this.changes = new HashMap<>(); | ||
|
||
for (Project project : appContext.getProjects()) { | ||
if (projectUnderGit(project)) { |
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.
isGitProject
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.
To me isProjectUnderGit
looks better. Do you mind?
} | ||
|
||
/** Queries from server all data needed to initialize the panel. */ | ||
private void loadPanelData() { |
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.
resolveGitRepositories
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 think, that current name is better, because there is noting to resolve here, just request data from wsagent.
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.
exposeGitRepositories
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.
ok...
|
||
private static final String EVENT_GIT_FILE_CHANGED = "event/git-change"; | ||
private static final String EVENT_GIT_STATUS_CHANGED = "event/git/status-changed"; | ||
private static final String EVENT_GIT_CHECKOUT = "event/git-checkout"; |
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.
it would be nice to have these constants shared between server and client code
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.
Yes, it would be great. But the issue is common for all rpc channels and probably we have to find general solution.
interface ActionDelegate extends BaseActionDelegate { | ||
|
||
/** | ||
* Invoked each time when user changes selection in repositories list. Returns null if no |
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.
Returns null if no selected items
it returns void
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.
Thank you! I meant argument...
} | ||
|
||
@Override | ||
public void onFileChanged(String endpointId, FileChangedEventDto dto) { |
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.
dto -> fileChangedEvent
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.
ok
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.
It would be great to use icons from http://fontawesome.io instead of your SVG icons where possible
ci-test |
ci-test build report: |
Signed-off-by: Mykola Morhun <[email protected]>
@slemeur we are going to merge it, do you have any concerns? |
Signed-off-by: Mykola Morhun <[email protected]>
ci-test |
Yes. The PR must not be merged: In this state, the panel can't be delivered to end-users! As I told in few discussions, there are few problems to fix in what the panel is showing currently:
Then, there is a bigger issue: The current state, is really a WIP. I would say that you might need to consider feature flag to introduce this kind of WIP/experimental feature. |
@mmorhun: if you decide to merge it with turned-off Git-panel, along with selenium test GitPanelTest.java for the panel, please, make sure that this test is excluded from test execution properly, that means:
Anyway, I don't like an idea of presence of selenium tests, which are aimed to test absent functionality, so as they should being supported as others tests, but this support would be useless. |
ci-test build report: |
We decided to merge this changes, but don't include it in IDE functionality. This is due to refactoring of some git events mechanism which probably will have merge conflicts very soon. To avoid hard merging and taking into account that we don't refuse git panel we are going to merge git panel code too. |
@dmytro-ndp can you elaborate please, what king of support we have to do for disabled tests? |
We should support various things which GitPanelTest uses:
That means that we can't change them without the risk to break the test logic, so as we can't ensure that without turning on the Git Panel and run the test. |
Signed-off-by: Mykola Morhun <[email protected]>
@Inject private AskDialog askDialog; | ||
@Inject private AskForValueDialog askForValueDialog; | ||
@Inject private TestUserPreferencesServiceClient testUserPreferencesServiceClient; | ||
@Inject private org.eclipse.che.selenium.pageobject.git.Git git; |
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.
Add org.eclipse.che.selenium.pageobject.git.Git into the import section.
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.
thank you
commitAllChangesInProject(JAVA_SPRING_GIT_PROJECT_NAME, "initial commit"); | ||
} | ||
|
||
@Test(priority = 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.
It's better to have independent tests inside the test class.
} | ||
|
||
/** | ||
* Converts file name to editor tab title for java projects. |
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.
Example of conversion will be quite useful here.
public void waitRepositoryPresent(String repository) { | ||
loadWait.until( | ||
ExpectedConditions.presenceOfElementLocated( | ||
By.xpath(String.format(Locators.REPOSITORY_BY_NAME, repository)))); |
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.
It's better to use static imports to improve readability.
Compare:
By.xpath(String.format(Locators.REPOSITORY_BY_NAME, repository))));
and
xpath(format(REPOSITORY_BY_NAME, repository))));
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.
Well, I am just afraid that many static imports could make our code less clear.
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.
Believe me - in case of Page Object many static imports make code much clear. @tolusha can confirm it.
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 won't confirm that. It is matter of personal preferences and certain cases
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.
@tolusha: hm, I thought you was supporter of usage of static imports, basing on your earlier comments like this https://github.com/codenvy-legacy/qa/pull/644#discussion_r104435935 :-|
Anyway, usage of static import for constants like Locators.REPOSITORY_BY_NAME is obvious improvement so as Locators is just an interface for constants.
We have to support them anyway, regardless of
I didn't add new resources, just reused existing. By the way, what kind of support you meant? As about the git panel test. The functionality will be hidden... nothing to test. We'll retest the scenario when include git panel functionality. I think this is optimal way. |
ci-test |
By support I mean keeping track of changes in methods of Page Objects and libraries, and content of resources which are used by TestGitPanel. When we will be changing the logic or signature of methods of dependent classes, or content of resources, we will need to ensure that changes don't break the test. To do this, we ought to turn-on the git panel, to run the test and potentially to correct it, and it will take a time. Otherwise this test will "dead" and we will remove it later anyway. |
What does this PR do?
Adds git panel to Che. The panel contains list of git repositories in workspace with label for each repository which shows number of changed files in it.
If selected repository have some changes, they will be displayed on the panel. Double click on changed file will show its diff.
The panel is updated dynamically and always keep actual state.
To quick show git panel
Alt + g
shortcut could be used.Selenium test is added for most common use cases.
What issues does this PR fix or reference?
#5128
#7022
Git panel added into Che.
Release Notes
Git panel with list of repositories and changed files list is added into Che.
Docs PR