Giter Club home page Giter Club logo

Comments (5)

arvindsv avatar arvindsv commented on May 18, 2024

It might not have worked, because this information is coming from the agent-side. So, the p4 wrapper would need to be replaced on the agent-side and the PATH of the agent should be changed.

I think what you said makes sense. For smaller projects, though, they might appreciate that extra information. I'm wondering about a more generic solution. Maybe making the console logs more configurable (ability to hide lines, marking task start better, etc). Should be able to do that in Javascript.

from gocd.

v1v avatar v1v commented on May 18, 2024

Regarding your suggestion, we replaced those p4 scripts on the agent-side, but it didn't work as we expected it.

Finally, we took the below script: https://github.com/programmiersportgruppe/go-defrustrator and added the below snippet:

    // Perforce  
    applyRegex(/\/\/(?!artifactory).*\n/g, "");    
    applyRegex(/(Client .* not changed)/g,"<span style='color: blue;'>$1</span>\n");

To be honest, that snippet works, but it takes longer to present that information. It would be worth if we would have a way of enabling/disabling that verbose output.

Technically, there is a minor change in order to get rid of that verbose output, but I'm not sure if the community would be agree about it:

Source: com/thoughtworks/go/domain/materials/perforce/P4Client.java
https://github.com/gocd/gocd/blob/master/common/src/com/thoughtworks/go/domain/materials/perforce/P4Client.java

as it is:

  public void sync(long revision, boolean shouldForce, ProcessOutputStreamConsumer outputStreamConsumer) {
        if (shouldForce) {
            execute(p4("sync", "-f", clientView() + "@" + revision), "", outputStreamConsumer, true);
        } else {
            execute(p4("sync", clientView() + "@" + revision), "", outputStreamConsumer, true);
        }
    }

would be:

    public void sync(long revision, boolean shouldForce, ProcessOutputStreamConsumer outputStreamConsumer) {
        if (shouldForce) {
            execute(p4("sync", "-q", "-f", clientView() + "@" + revision), "", outputStreamConsumer, true);
        } else {
            execute(p4("sync", "-q", clientView() + "@" + revision), "", outputStreamConsumer, true);
        }
    }

Obviously, it would be great to have a flag (checkbox) under the materials configuration in order to enable/disable it, but likely it would affect some changes within the database. I would be happy to develop that feature but I need some tech advices about it. Let me know If you have any clues about it.

Cheers

from gocd.

v1v avatar v1v commented on May 18, 2024

Hi again,
any suggestions about this ticket?
Thanks

from gocd.

arvindsv avatar arvindsv commented on May 18, 2024

Hey @v1v,

That sounds like a good idea. You seem to have found the right code as well. Making it configurable, is the important part here, as you mentioned. Luckily, in this case, we can make a change that affects only the configuration and not the database (with a caveat). So, I think it'll be good for you to try to do this. I can help you.

I wrote detailed steps to do this, but thought maybe you'll want to find it out yourself. :) So, I've written slightly high-level steps here. Let me know if you need more help or details. I'll be happy to provide them:

  1. Add a config migration to upgrade schema version. As a part of it, make a new flag (say, "quietOutput") part of the XSD for the P4 part of the configuration.
  2. Now that the XML can be saved with the flag, you need to connect it to the code. You should make changes here and here and then in P4Client (the place you mentioned earlier).
  3. Changing the UI (optional): This would be the file to look at.

Caveat:

This works for current runs, but since the flag is not stored in the database, it will not be used for reruns (if you rerun an older instance). It will then revert to the default (verbose output) for that run. I think it's a good tradeoff.

If you need more details, just let me know.

Cheers,
Aravind

from gocd.

arvindsv avatar arvindsv commented on May 18, 2024

Closing as stale.

from gocd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.