Skip to content

osc project doesn't check context first #1349

Closed

Description

@smarterclayton

If I have a context set called "foo" and I do osc project foo, I should go into that context. The current code does not do that - I'm pretty sure I added that as a comment on that pull request.

Activity

  1. added
    kind/bug
    on Mar 18, 2015
  2. added this to the milestone on Mar 20, 2015
  3. fabianofranz commented on Mar 20, 2015

    @fabianofranz
    Contributor

    @smarterclayton When doing osc project <something> try to use a context first, correct? In case you have a ctx and a project with the same name.

  4. smarterclayton commented on Mar 20, 2015

    @smarterclayton
    ContributorAuthor

    Precedence (i think):

    User says osc project foo

    1. I have a context called "foo" -> switch to it, no calls to the master
    2. Check for a project called "foo" on the current server and user
      1. If one exists, create a new context "foo" pointing to project foo, reuse current server and user
      2. If none exist, tell the user (and list the contexts you have)

    When you switch projects, display the context name AND project name if they differ. Also list the server and user.

    If you pass osc projects -a or --all, list all contexts (do the same display thing as above).

    Basically, "projects" switches contexts based on the name of projects.

    ----- Original Message -----

    @smarterclayton When doing osc project <something> try to use a context
    first, correct? In case you have a ctx and a project with the same name.


    Reply to this email directly or view it on GitHub:
    #1349 (comment)

  5. fabianofranz commented on Mar 20, 2015

    @fabianofranz
    Contributor

    @smarterclayton Sounds good, pretty much what I was thinking about precedence. Let me check how subsequent commands will behave when switching to a ctx without calling master and that context behaves like session expired, context does not make a namespace explicit, etc. But should be good.

  6. fabianofranz commented on Mar 20, 2015

    @fabianofranz
    Contributor

    @smarterclayton BTW I'm finding a little confusing how the naming logic works when saving to config files - clusters named localhost:8443 and contexts named localhost:8443-ffranz. I think I'll change it to replace : and . and make it name: localhost-8443 for example. Is it just me?

  7. smarterclayton commented on Mar 20, 2015

    @smarterclayton
    ContributorAuthor

    I do like that better. Maybe the first server should have no port, but later ones should have (choose context name in order of ease of use, with more specificity if someone claimed the general name).

    On Mar 20, 2015, at 2:29 PM, Fabiano Franz [email protected] wrote:

    @smarterclayton BTW I'm finding a little confusing how the naming logic works when saving to config files - clusters named localhost:8443 and contexts named localhost:8443-ffranz. I think I'll change it to replace : and . and make it name: localhost-8443 for example. Is it just me?

    —
    Reply to this email directly or view it on GitHub.

  8. smarterclayton commented on Mar 20, 2015

    @smarterclayton
    ContributorAuthor

    We need to have stuff upstream for error handling, I want to see that happen independently.

    On Mar 20, 2015, at 2:24 PM, Fabiano Franz [email protected] wrote:

    @smarterclayton Sounds good, pretty much what I was thinking about precedence. Let me check how subsequent commands will behave when switching to a ctx without calling master and that context behaves like session expired, context does not make a namespace explicit, etc. But should be good.

    —
    Reply to this email directly or view it on GitHub.

  9. fabianofranz commented on Mar 20, 2015

    @fabianofranz
    Contributor

    PR opened: #1405. See comments.
    Not yet addressing the naming logic change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions