Jump to content


Is there a way to fail submit if specific code was found on it?

p4 triggers submit scan code code patterns p4

  • Please log in to reply
1 reply to this topic

#1 MaxBk

MaxBk

    Member

  • Members
  • PipPip
  • 12 posts

Posted 09 March 2017 - 01:48 PM

Hi,
So recently some team leaders asked if it's possible to force fail a submit if some code pattern was found on the "submitting files".
For example.
John doe wants to submit Test.cs
Test.cs Has many functions and one of the functions uses the next code:
public string badUsage(){
var a = 0;
var b ="Password";

return otherFunction(a,B);
}

And I want to fail submit if I see the next pattern:
var b ="Password";

return otherFunction(

I was thinking about making a tiger for submission the code for specific regex but I think that there might be a better way/tool/plugin that could do that.

What do you guys think?
What's the best way to implement this?

Thanks in advance,
Max.

#2 Mailman Sync

Mailman Sync

    Advanced Member

  • Maillist Aggregator
  • 2495 posts

Posted 09 March 2017 - 02:05 PM

Originally posted to the perforce-user mailing list by: Michael Mirman


A content trigger is the only reliable way to do this.
It is possible to have tools and plugins on the client side, but it's easy enough to work around them and use the actual submit.

My 0.02

--
Michael Mirman
MathWorks, Inc.
3 Apple Hill Drive, Natick, MA 01760
508-647-7555

Quote

-----Original Message-----
From: perforce-user [mailto:perforce-user-bounces@perforce.com] On
Behalf Of MaxBk
Sent: Thursday, March 09, 2017 8:50 AM
To: perforce-user@perforce.com
Subject: [p4] Is there a way to fail submit if specific code was found on it?

Posted on behalf of forum user 'MaxBk'.

Hi,
So recently some team leaders asked if it's possible to force fail a submit
if some code pattern was found on the "submitting files".
For example.
John doe wants to submit Test.cs
Test.cs Has many functions and one of the functions uses the next code:
public string badUsage(){ var a = 0; var b ="Password"; return
otherFunction(a,B); }
And I want to fail submit if I see the next pattern:
var b ="Password"; return otherFunction(
I was thinking about making a tiger for submission the code for specific regex
but I think that there might be a better way/tool/plugin that could do that.

What do you guys think?
What's the best way to implement this?

Thanks in advance,
Max.



--
Please click here to see the post in its original format:
  http://forums.perfor...-a-way-to-fail-
submit-if-specific-code-was-found-on-it
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user
_______________________________________________
perforce-user mailing list  -  perforce-user@perforce.com
http://maillist.perf...o/perforce-user







Also tagged with one or more of these keywords: p4 triggers, submit, scan code, code patterns, p4

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users