Jump to content
jwvanderbeck

Color changeset based on presence of attribute regardless of value?

Recommended Posts

I'm still trying to find the best workflow here so suggestions are welcome, but here is where I am now.  When we want to do a build, using Unity Cloud Build, then we will GitSync the branch to Gitlab which in turn connects to UCB and does a build for Mac and Windows.  Previously I would then add a Label to the changeset indicating the build # on UCB to keep a connection there.  This was ok but got a bit cluttered when we added Mac builds, so now two labels, and possibly more in the future.  So instead I decided to move to putting the build #s in attributes instead.  This works fine but there is no clear way to tell a changeset was sent to UCB.

So what I tried to do was add a custom changeset color something like this: attribute='Windows Alpha Build' or attribute='MacAlpha Build'

I don't care what value the attribute has, just asking if it has either of these attributes, color it.  Doesn't work though.  Is there a way to do this? For now I've added a third attribute that I just set to "yes" when a build was sent, but this feels clumsy and the fact that an attribute HAS to have a value makes it a little more clumsy.

 

EDIT: Ok I got this working.  Seems I think a bug in how the conditional formatting is set parsed.  After posting this I saw that I had a typo in the second attribute, where it was put as 'MacAlpha Build' when it should have been 'Mac Alpha Build'.  When I fixed the missing space suddenly the coloring worked.  However, as that is an OR condition, it seems it shoudl have worked even with the typo which makes me suspect my conditional isn't working the way I expect.

Share this post


Link to post
Share on other sites

To follow on with this, it also doesn't appear that these are "dynamic".  In otherwords, once a changeset has a color assigned, changing its attributes won't give it a new color if the changes would result in a new color being assigned.

To get the new color I have to disable one of the rules, then re-enable it, which will then make the "Apply" button active again.  Then clicking in Apply will update the colors.

It would be really nice if these were more dynamic, so that changing an attribute automatically refreshes the colors.  If this is not doable, can we at least have a button to easily refresh rather than dancing with the formatting rules?

EDIT: Just realized I can refresh the Branch Explorer view to update.  Still it would be nice if changing a branch or changeset's attributes would just refresh the formatting for that item rather than having to wait for the entire view to be recalculated.

Share this post


Link to post
Share on other sites

Hi,

After reading the EDIT in both messages, you are already up and running with the attributes and color changesets, right?

Regards,

Carlos.

Share this post


Link to post
Share on other sites

In the end it won't make a difference, but in your case you should consider making only ONE attribute (such as "Build Version"), and then use the attribute value to set it to Windows or Mac (and then use "attrvalue" instead of "attribute" to query these).
The idea of attributes+values could be compared to an enum, while just using the attribute itself (and only having a single possible value that is always set, such as "true") is more similar to a bool/flag.
It would be a useful feature to also have special "flag attributes" for these, which are just set, without requiring a value. But the overhead of also setting the value to "true" is probably not that big (especially since you can click on the right of the "Value" field, there is a hidden drop down menu which will show you all values this attribute currently has).

Screenshot (106).png

Share this post


Link to post
Share on other sites
2 hours ago, Wolfram said:

In the end it won't make a difference, but in your case you should consider making only ONE attribute (such as "Build Version"), and then use the attribute value to set it to Windows or Mac (and then use "attrvalue" instead of "attribute" to query these).
The idea of attributes+values could be compared to an enum, while just using the attribute itself (and only having a single possible value that is always set, such as "true") is more similar to a bool/flag.
It would be a useful feature to also have special "flag attributes" for these, which are just set, without requiring a value. But the overhead of also setting the value to "true" is probably not that big (especially since you can click on the right of the "Value" field, there is a hidden drop down menu which will show you all values this attribute currently has).

Screenshot (106).png

The idea is to track the windows AND mac build # on Unity Cloud Build so both attributes are needed.  Wanting to check if either value is present is just a way to see if either build was done without having to have a third flag attribute.

Thanks for pointing out the "hidden" button though for seeing previous values.  I was going to suggest the ability to preset values to choose form so human errors don't occur.  Not sure why that button is LITERALLY hidden as it is super useful!

Share this post


Link to post
Share on other sites
2 hours ago, calbzam said:

Hi,

After reading the EDIT in both messages, you are already up and running with the attributes and color changesets, right?

Regards,

Carlos.

Yes, working, except for the issue of having to refresh the entire branch explorer view every time an attribute is added/changed/removed.

Share this post


Link to post
Share on other sites
5 hours ago, calbzam said:

Hi,

After reading the EDIT in both messages, you are already up and running with the attributes and color changesets, right?

Regards,

Carlos.

Also to clarify here, yes I have it working but it doesn't explain why the original query didn't work.  Seems like there is a bug in how the query works, or I specified it wrong.  Some clarity there would be appreciate.

 

Share this post


Link to post
Share on other sites
17 hours ago, jwvanderbeck said:

Also to clarify here, yes I have it working but it doesn't explain why the original query didn't work.  Seems like there is a bug in how the query works, or I specified it wrong.  Some clarity there would be appreciate.

 

EDIT: sorry, apparently I'm still asleep... x-P 
Ignore this post, I can't delete it. 
I just realized you are talking about attributes, not labels. But maybe there is a similar problem (i.e., that not all attributes are checked?)

 

 

This sound like the following bug, for which a fix will be released soon:

 

Share this post


Link to post
Share on other sites
4 hours ago, Wolfram said:

EDIT: sorry, apparently I'm still asleep... x-P 
Ignore this post, I can't delete it. 
I just realized you are talking about attributes, not labels. But maybe there is a similar problem (i.e., that not all attributes are checked?)

 

 

This sound like the following bug, for which a fix will be released soon:

 

Possibly.  In my case it seemed that it was only looking at the last condition in a logical OR rather than all of them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...