Giter Club home page Giter Club logo

Comments (14)

Jo-IE avatar Jo-IE commented on June 28, 2024

Hi @djmitche is this issue open to outreachy applicants? Thanks!

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

It is, but note that it's in Go, not JS!

from taskcluster.

Jo-IE avatar Jo-IE commented on June 28, 2024

I just started learning Go and I would like to learn more, could I still work on it?

from taskcluster.

Jo-IE avatar Jo-IE commented on June 28, 2024

bump :)

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

Sure, have at it :)

from taskcluster.

Jo-IE avatar Jo-IE commented on June 28, 2024

Are these the steps to follow when getting this set up? https://github.com/taskcluster/taskcluster/blob/master/dev-docs/development-process.md#hacking-on-clients

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

No, that's a little outdated in fact, since it doesn't mention client-shell.

Like most go projects, you should be able to just run go test ./... in the clients/client-shell directory to get the tests to run. Unlike most go projects this one uses go mod so it doesn't need to be checked out in a particular directory -- it should just work. Note that you'll need go1.12.9.

from taskcluster.

Jo-IE avatar Jo-IE commented on June 28, 2024

ok thank you!

from taskcluster.

Jo-IE avatar Jo-IE commented on June 28, 2024

Hi @djmitche sorry for not getting back to you sooner but here is my progress so far:

I understand that I am to make a verbose -v flag for the version command that directs output to stderr when present or null otherwise and this should be implemented using the log library.

I have added the verbose flag to the version command as explained in the Cobra docs.

I am guessing we will be using the output function from the log library log.Output(calldepth, string) to implement the output. However, I do not understand what the function is supposed to be doing. For example, if I had something like log.Output(1, "verbose"), I do not know what that is supposed to print in this context.

Any tips would be helpful!

Thank you.

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

I think we want this option for all commands, not just version. Logging for the version command isn't that interesting! Maybe a better example is the taskcluster group cancel command?

I think this will involve a few things:

  1. setting up a Logger that is available for every command
  2. configuring that logger (via l.SetOutput) based on whether --verbose was passed
  3. updating commands that output some status while they work (such as "cancelling task ") to use the Logger instead of just calling fmt.Fprintf.

I don't think there are many examples of the latter. The first two steps will be the more time-consuming steps.

from taskcluster.

vnzongzna avatar vnzongzna commented on June 28, 2024

Hi @djmitche
I would like to work on this issue 🙂

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

It's all yours!

from taskcluster.

vnzongzna avatar vnzongzna commented on June 28, 2024

@djmitche since all the subcommands are separated by packages, do we have to define a verbose flag in each command seperately? or can we have a single PersistentPreRun that can be defined for root command and use that instead?
A sample snippet that I could find from Scaffold

func Command() *cobra.Command {
	rootCmd.PersistentPreRunE = func(cmd *cobra.Command, args []string) error {
		if err := setUpLogs(os.Stdout, v); err != nil {
			return err
		}
		return nil
	}
	rootCmd.PersistentFlags().StringVarP(&v, "verbose", "v", logrus.WarnLevel.String(), "Log level (debug, info, warn, error, fatal, panic")

	return rootCmd
}

from taskcluster.

djmitche avatar djmitche commented on June 28, 2024

I don't know much about Cobra, but if that approach works, it seems like the best solution.

from taskcluster.

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.