Perforce - How to get Label details using Label name with wildcard - perforce

I am new to Perforce. I need a 'p4' client command to get Label(s) by providing Label name.
However I don't know complete Label name so I want to provide wildcard in the Label name.
In P4V client I do it this way:

If you look in P4V's log pane you can see what command(s) it's running to get its data. For labels it's probably running something like:
p4 labels -e "cobrands.razor*build_01"

Related

How can I share a workspace definition between multiple hosts?

I have created a Perforce workspace definition with which I will be able to "run the latest demo" on a PC.
Then I wanted to try and check out the same workspace on another PC in order to run the same demo. I found that I could not do this because the workspace is somehow tied to the first PC where I created it.
I ended up copying the workspace by
inspecting the textual definition of the workspace and copying it to a text editor,
searching and replacing "WantedWorkspaceName" with "WantedWorkspaceName_NewHostname",
creating a new workspace with a new name ("WantedWorkspaceName_NewHostname"),
giving the new workspace the same workspace root path ("D:\Demo") as the original workspace,
pasting the modified textual representation into the textual representation of the new workspace.
Surely there must be a better way to achieve what I want? (Use the same workspace mapping on different hosts.)
Just use the -t template option to p4 client:
p4 client -t WantedWorkspaceName WantedWorkspaceName_NewHostname
You may also want to look at streams, which are an alternative way of setting up client/branch mappings. Rather than configuring each client individually, you define a single "stream" which encapsulates a set of depot mappings and branching relationships to other streams. Then a client can be defined simply in terms of what stream it's associated with, and the views are auto-generated whenever the stream is changed.

Perforce file(s) not in client view

I have setup a new Perforce server via docker. I have an admin user and I can connect to it successfully.
It is of course an empty server, so I created a new workspace called foo with the following view:
//depot/... //foo/depot/...
Adding any new file fails in:
/Users/test/workspace_foo/file - file(s) not in client view.
I found this problem hundreds of times, but I am beyond the step of missing to create a workspace view, still it does not work. Any idea what I am missing here?
I struggled hard on this. And I'm not sure if I finally understood the real cause why it's working now.
To me, it looks like you need to create the mapping with the three dots as expression in order to be able to create a more specific one.
Example Here
However, after I added the 'three-dot-mapping' I could finally add all my files without any trouble. What doubts me a little is that after I opened the Mapping again, my 'three-dot-mapping' disappeared, and it just showed me a mapping to the folder I added.
As I understood, you need the
//depot/... <-> /Users/test/workspace_foo/...
mapping in order to be able to create a
//depot/anotherFolder <-> /Users/test/workspace_foo/anotherFolder
mapping. Also make sure, that first you add a file / folder directly under /Users/test/workspace_foo/....
If anyone has further explanations for this, I look forward hearing them.
I'm going to assume that your workspace's root is /Users/test/workspace_foo. That's what //foo in your client view corresponds to:
Client: foo
Root: /Users/test/workspace_foo
View:
//depot/... //foo/depot/...
right? So that means that:
//depot/... <-> /Users/test/workspace_foo/depot/...
Sidebar: The p4 where command will show you the depot-syntax, client-syntax, and local-syntax version of any given path; use p4 where //... to see your entire client mapping with overlapping view entries disambiguated and client paths expanded to local syntax.
The local file you're trying to add is not within the local path of the client view you've defined, which is why you're getting the error file(s) not in client view. If you want to leave your view mapping the way it is, you'll need to move file into a path under /Users/test/workspace_foo/depot in order to be able to add it. Whatever path you create on the client relative to /Users/test/workspace_foo/depot will be created on the server relative to //depot.
If you want /Users/test/workspace_foo/file to map to //depot/file, then change your View like this:
Client: foo
Root: /Users/test/workspace_foo
View:
//depot/... //foo/...
which means that:
//depot/... <-> /Users/test/workspace_foo/...
and therefore:
/Users/test/workspace_foo/file <-> //depot/file

Is it possible to set/change mlflow run name after run initial creation?

I could not find a way yet of setting the runs name after the first start_run for that run (we can pass a name there).
I Know we can use tags but that is not the same thing. I would like to add a run relevant name, but very often we know the name only after run evaluation or while we're running the run interactively in notebook for example.
It is possible to edit run names from the MLflow UI. First, click into the run whose name you'd like to edit.
Then, edit the run name by clicking the dropdown next the run name (i.e. the downward-pointing caret in this image):
There's currently no stable public API for setting run names - however, you can programmatically set/edit run names by setting the tag with key mlflow.runName, which is what the UI (currently) does under the hood.
If you are using the latest version of mlflow as of now (1.26.0), the rename functionality UI has changed a bit to look like the below image where you can change the run name by using the 3 dots in the extreme right side.
use the system tag directly:
mlflow.set_tag("mlflow.runName", "run_name")
https://github.com/mlflow/mlflow/issues/2804#issuecomment-640056129

Setting up Default Description Template on P4 Client

While creating new changelist is there a way that I can create default description template. So whenever I will create new changelist I want some of the details to be pre-populated on my p4 client.
Below is an example to prepopulated template that I would like to have:
Summary:
Fix:
Impact:
Testing:
Unit Testing:
Documentation:
QA:
Localization:
Jira-Id:
To do this for all users on the server, set up a form-out trigger on the change form and replace the default template with your own template. The simplest possible version of this is a sed one-liner:
Triggers:
form-out change "sed -i s/<.*>/fnord/ %formfile%"
You can replace this with something arbitrarily complex (maybe you want to modify the template per user, etc.)
If you want to just do it for yourself on your own client machine, do it in your editor (e.g. have a macro that replaces <enter description here> with your template). If you can't do it in your editor, you can do it outside your editor by wrapping it in a script that does something like:
sed -i s/<.*>/fnord/ $1
vi $1
and then do:
p4 set P4EDITOR=my-wrapper.sh

How to create a job and attach it to a new changelist in perforce CLI?

using p4 change, I can create a new changelist but it requires a 'form' to be filled.
Is there a way for me to create a job with a particular template, get that job number and attach it to a new changelist with a particular template?
No, unfortunately you have to use the forms, i.e. temp files, or cmdline I/O redirection.
The alternative is to use a P4 API (e.g. P4Perl, P4Python, etc.) which gives you a way to specify all the change's details (the ones you would fill into the form) as structured data.

Resources