Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code info cli command #106

Closed
treeder opened this issue Jul 30, 2012 · 15 comments
Closed

Add code info cli command #106

treeder opened this issue Jul 30, 2012 · 15 comments
Assignees

Comments

@treeder
Copy link
Contributor

treeder commented Jul 30, 2012

Usage:

iron_worker info my_worker

Would return:

  • id
  • max_concurrency
  • etc.
romand pushed a commit to romand/iron_worker_ruby_ng that referenced this issue Aug 1, 2012
@romand
Copy link
Contributor

romand commented Aug 1, 2012

@treeder please check out output

% iron_worker info hello
------> Detecting Configuration
        Working with project 'test4' with id 5007f0b90948517baf003e29
        Code package 'hello' with id 5007f0eb27e1e8378206ce78, created at Thu Jul 19 11:35:07
        Latest change was at Wed Aug 1 00:27:13 revision 59
        Revisions: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/code/5007f0eb27e1e8378206ce78
        Tasks: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/jobs/5007f0eb27e1e8378206ce78/activity
% iron_worker info hello1
------> Detecting Configuration
        Working with project 'test4' with id 5007f0b90948517baf003e29
        Code package named 'hello1' not found

@romand
Copy link
Contributor

romand commented Aug 1, 2012

I'm thinking about similar function for tasks and schedules.
Do we need those? If yes, how do we name them? Worth deciding now, until command 'info' released.

@ghost ghost assigned romand Aug 1, 2012
romand pushed a commit that referenced this issue Aug 1, 2012
@romand
Copy link
Contributor

romand commented Aug 1, 2012

added arrow before 'Code package...'

% iron_worker info hello
------> Detecting Configuration
        Working with project 'test4' with id 5007f0b90948517baf003e29
------> Code package 'hello' with id 5007f0eb27e1e8378206ce78, created at Thu Jul 19 11:35:07
        Latest change was at Wed Aug 1 00:27:13 revision 59
        Revisions: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/code/5007f0eb27e1e8378206ce78
        Tasks: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/jobs/5007f0eb27e1e8378206ce78/activity

@treeder
Copy link
Contributor Author

treeder commented Aug 3, 2012

Per @iced 's suggestion:

iron_worker info code hello
iron_worker info task ID
iron_worker info schedule ID

@carimura
Copy link
Contributor

carimura commented Aug 3, 2012

@romand-ironio see modifications below .. thoughts?

% iron_worker info hello
------> Detecting Configuration
        Working with project 'test4' with id 5007f0b90948517baf003e29
------> Found Code package 'hello'
        id: 5007f0eb27e1e8378206ce78
        Created: Thu Jul 19 11:35:07
        Last Modified: Wed Aug 1 00:27:13
        Revision: 59
        All Revisions: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/code/5007f0eb27e1e8378206ce78
        Tasks: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/jobs/5007f0eb27e1e8378206ce78/activity
% iron_worker info hello1
------> Detecting Configuration
        Working with project 'test4' with id 5007f0b90948517baf003e29
        Code package named 'hello1' not found

@romand
Copy link
Contributor

romand commented Aug 3, 2012

@treeder I think we can introduce autodetection of argument here.

We can try to interpret 'info' argument as:

  1. code package name
  2. some id -- code package, task or schedule
    Unless ids for those entities overlap, I don't see any obstacles for autodetection. @iced do you?
    If some code package name overlaps with some id, we can output details for both.

@treeder
Copy link
Contributor Author

treeder commented Aug 3, 2012

That's interesting. I suppose API would need an endpoint to take any ID and figure out what it is?

@romand
Copy link
Contributor

romand commented Aug 3, 2012

we can try all options in CLI, no need in separate API call

@treeder
Copy link
Contributor Author

treeder commented Aug 4, 2012

Ahh, I see. I think it would best to be explicit then, slow/wasteful to try 3 times for each request.

Let's stick to the info code X style.

@romand
Copy link
Contributor

romand commented Aug 7, 2012

@treeder extra requests doesn't seem to be bottleneck here

% time iron_worker info adsfasdf   
------> Detecting Configuration
        Project 'test4' with id='5007f0b90948517baf003e29'
        Nothing found identified by 'adsfasdf'
iron_worker info adsfasdf  0,62s user 0,04s system 20% cpu 3,214 total

@iced what is your opinion?

@iced
Copy link
Contributor

iced commented Aug 8, 2012

info code XX
info task XX
info whatever XX

romand pushed a commit that referenced this issue Aug 9, 2012
romand pushed a commit that referenced this issue Aug 9, 2012
@romand
Copy link
Contributor

romand commented Aug 9, 2012

@evan to implement schedule info command properly, list of possible fields returned by API along with situations when they appear needed

as I can see from hud source code, following fields are available:

  • start_at
  • end_at
  • run_times
  • run_every
  • delay_type
  • priority
  • status
  • created_at
  • updated_at
  • next_start (displayed in hud only if in future, should we copy that logic?)
  • last_run_time
  • run_count

Are all those fields exposed to API response literally?
Anything else worth to mention in output?

@romand
Copy link
Contributor

romand commented Aug 9, 2012


% ruby -Ilib bin/iron_worker info schedule 5022f9fc0a468138281f464b
------> Detecting Configuration
        Project 'test4' with id='5007f0b90948517baf003e29'
------> Schedule id 5022f9fc0a468138281f464b found
         Code Name: hello
           Created: Wed Aug 8 23:45:00
           Message: Single execution complete.
            Status: complete
             Start: Wed Aug 8 23:45:00
        Next Start: Wed Aug 8 23:45:00
         Run Count: 1
           Details: https://hud.iron.io/tq/projects/5007f0b90948517baf003e29/scheduled_jobs/5022f9fc0a468138281f464b

@romand
Copy link
Contributor

romand commented Aug 22, 2012

TODO:
Travis Reeder 3:40: add Max concurrency too

@iced
Copy link
Contributor

iced commented Sep 5, 2012

done

@iced iced closed this as completed Sep 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants