Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1299633

Summary: [GSS](6.2.z) Not able to select specific branch from repository
Product: [Retired] JBoss BRMS Platform 6 Reporter: Alessandro Lazarotti <alazarot>
Component: Business CentralAssignee: Toni Rikkola <trikkola>
Status: CLOSED NEXTRELEASE QA Contact: Zuzana Krejčová <zkrejcov>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: abhumbe, ajhajj, alazarot, jholmes, kverlaen, lpetrovi, rrajasek, rsynek, trikkola, zkrejcov
Target Milestone: CR2   
Target Release: 6.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1217006
: 1304447 (view as bug list) Environment:
Last Closed: 2016-02-03 16:27:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1217006    
Bug Blocks: 1218511, 1288021, 1288023, 1304447    

Description Alessandro Lazarotti 2016-01-18 19:58:01 UTC
+++ This bug was initially created as a clone of Bug #1217006 +++

Description of problem:
I have attached repository(.niogit) which has two branches: dev and master.'master' branch has single project(project1) and 'dev' branch has two project(new & project1). But cant select specific branch from Administration. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Import attached repository
2. Goto Authoring-->Administration and select 'master' branch. In the left panel we can see only one project is listed, click on Update button.
3. Now goto "Authoring"-->Project authoring, we can see both project from 'dev' branch. 
4. Again if we go back to Authoring-->Administration then we can see its referring to 'dev' branch only.

Actual results:
Not able to change branch.

Expected results:
should be able to change branch.


Additional info:

--- Additional comment from JBoss Product and Program Management on 2015-04-29 08:00:07 EDT ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Alessandro Lazarotti on 2015-06-01 09:25:15 EDT ---

Assigning to Toni as recommended by Salaboy at:

https://bugzilla.redhat.com/show_bug.cgi?id=1218511#c4
https://bugzilla.redhat.com/show_bug.cgi?id=1218511#c7

--- Additional comment from Alessandro Lazarotti on 2015-06-01 09:26:06 EDT ---

As commented in the other bug: "The button in Administration is a global switch that shouldn't be there anymore. "

--- Additional comment from Toni Rikkola on 2015-11-09 09:11:49 EST ---

Looks like this ticket is a duplicate with this Jira.

https://issues.jboss.org/browse/GUVNOR-2285

PR with the fix: 
https://github.com/droolsjbpm/kie-wb-common/pull/130

--- Additional comment from Toni Rikkola on 2015-11-10 03:52:11 EST ---

https://github.com/droolsjbpm/kie-wb-common/commit/e363e7a19e9a974e45a9059b03e45ac96a8a419e

--- Additional comment from Toni Rikkola on 2015-11-10 03:52:32 EST ---

(In reply to Toni Rikkola from comment #5)
> https://github.com/droolsjbpm/kie-wb-common/commit/
> e363e7a19e9a974e45a9059b03e45ac96a8a419e

This fix is for master.

Comment 2 Toni Rikkola 2016-01-29 10:41:21 UTC
6.3.x : https://github.com/droolsjbpm/kie-wb-common/commit/4b5ddb3e9

Comment 3 Zuzana Krejčová 2016-02-02 15:41:03 UTC
+ Selecting a branch in Administration (select a branch and click Update) will update the repo content visible in Administration.
- Selecting a branch in Administration doesn't update the branch selector or repo content in Authoring.
+ Selecting a branch in Authoring however does update the branch selector and repo content in Administration.
- Selecting a branch in Authoring unfortunately doesn't update the shown repo content in Authoring. If there is no project on master branch, switching to another branch that does have a project has no effect.

Tested with a simple repo with 3 branches - master (no project), dev (freshly created maven project with the default example class and test), bugfix (same as dev, but project name and artifact changed to 'test').

Comment 4 Toni Rikkola 2016-02-02 16:47:17 UTC
(In reply to Zuzana Krejčová from comment #3)
> + Selecting a branch in Administration (select a branch and click Update)
> will update the repo content visible in Administration.
> - Selecting a branch in Administration doesn't update the branch selector or
> repo content in Authoring.

I think this should only change if the user has never ever opened the Authoring mode. Or any other mode that sets the project context to some branch. This selector sets the the default branch for all the users, but if the user has viewed any branch, usually master, then he needs to change it in the Project Editor. This is the only place where the user can set his own current branch.

> + Selecting a branch in Authoring however does update the branch selector
> and repo content in Administration.
> - Selecting a branch in Authoring unfortunately doesn't update the shown
> repo content in Authoring. If there is no project on master branch,
> switching to another branch that does have a project has no effect.

So based on the report there are 1-2 bugs:

1. The branch selector in Authoring should have no effect on the selector in Administration. 

2. The repo content shown in Authoring should respect the branch selector in Project Explorer, since this changes the current active branch for the entire workbench. If not, then it should have a branch selector of it's own. This makes this either a bug or/and a missing feature.

Comment 5 Toni Rikkola 2016-02-03 09:28:45 UTC
Ok, so after double checking the branch selectors in both locations are just for changing the workbench active branch for the current user. Making it so.

Comment 6 Zuzana Krejčová 2016-02-03 11:44:29 UTC
(In reply to Toni Rikkola from comment #5)
> Ok, so after double checking the branch selectors in both locations are just
> for changing the workbench active branch for the current user. Making it so.

So, if I understand correctly, making a change in one location should always also update the other location, right? And only for that one user, correct?

Comment 7 Toni Rikkola 2016-02-03 12:46:07 UTC
With some limitations.

We only remember the last set branch. Meaning if you have two repositories, you set A to branch RELEASE and B to branch DEV. When you go back to Authoring it shows B repository in DEV branch and when you go back into Administration it B is in DEV, but A is in master ( or what ever branch is first in the list ).

Comment 8 Zuzana Krejčová 2016-02-03 13:05:02 UTC
Ok, thanks.

That actually sounds like a bug or missing/unfinished feature - not in the scope of this bug though, so... good to know.

Comment 10 Amritpal Jhajj 2016-02-03 17:19:03 UTC
(In reply to Toni Rikkola from comment #7)
> With some limitations.
> 
> We only remember the last set branch. Meaning if you have two repositories,
> you set A to branch RELEASE and B to branch DEV. When you go back to
> Authoring it shows B repository in DEV branch and when you go back into
> Administration it B is in DEV, but A is in master ( or what ever branch is
> first in the list ).

I want to confirm my understanding here.  Is it correct to say that this limitation/behavior is consistent on a per user basis but not across users?  ie. user1's branch selection does not impact user2's active branch.

Comment 11 Toni Rikkola 2016-02-04 06:42:35 UTC
Currently the branch selector in Administration changes the branch for all the users. This can cause the screen that lists the repositories in the Administration perspective to be out of sync with the rest of the workbench.

I'm fixing this for the master.