Code Monkey home page Code Monkey logo

Comments (7)

afiune avatar afiune commented on August 22, 2024

@tonyflint my good friend! 😄 Thank you so much for creating a nice documented issue. We really appreciate all the feedback y'all have provided to us.

I definitely see the issue that happened here, but just to clarify the current behavior. The delivery-cli does NOT verify the repository name that you are trying to link between GHE and Workflow. The main reason is that Workflow Server allows you to do that; You can link a Project with a different name than the name of the repository in GHE.

Having said that, I agree in the following ideas that you provided:

Reporting a better error message from the delivery init command, e.g. ERROR: existing project already pointing at

We can definitely do this, although we might have to wait a bit since we are coding the GHEv2 but we might be able to include this new feature on the board.

Reporting a better error message in the delivery server logs e.g. ERROR: existing project already pointing at in addition to/instead of the existing one, which assumes at least some knowledge of how the DB schema works with delivery.

This also feels right, I will pass along this new feature as well. 😄

Do you feel that doing these two things above will solve or mitigate this problem you had? Let us know what are your thoughts... Thanks!

from delivery-cli.

sdelano avatar sdelano commented on August 22, 2024

@tonyflint @afiune - thanks for the detailed report!

We're currently working on the next version of Chef Automate and GitHub integration. Currently, we only support creating "new-style" GitHub integrations via the web console, but when the feature is complete you will be able to create integrated projects via the command line in the same way as you've done above.

I've verified as well that the repo creation API for new-style GitHub projects does indeed return a 409 Conflict with a helpful error message when trying to link to a GitHub repo that has already been linked to.

When this feature is complete, all GitHub-integrated projects will be migrated to the new style and this feature will make it into the core API. Because of this, we'll not be fixing up the existing API. The new API is scheduled to be released within a few weeks.

Thanks!

@afiune - I'll leave this ticket open if you'd like to address any of the cli-only issues like directory name warning or enforcing project + repo naming conventions.

from delivery-cli.

afiune avatar afiune commented on August 22, 2024

@tonyflint I would like to ask you for some feedback. 😄

If when you run the delivery init command it display something like this:

➜  my_A_project git:(master) delivery init --github org --repo-name my_B_project
Chef Delivery
Loading configuration from /Users/salimafiune/chef/delivery/organizations/sandbox/my_A_project
WARN: The directory you are located does't match with the repository name you are trying to initialize.
Press Enter to continue or Ctr+C to abort.^C

Where if you press Enter it will continue, but if you don't you have to exit with Ctrl+C.

Would you consider this as a good solution for the directory problems you mentioned above?

I am open to suggestions! Thanks!! 🎉

from delivery-cli.

TonyLovesDevOps avatar TonyLovesDevOps commented on August 22, 2024

@afiune Thanks for asking!!

In my view, the error message should state what the impact will be or what might go wrong. For example, I think in your example, running delivery init --github org --repo-name my_B_project within a folder named my_A_project, the project within the delivery UI would be called my_A_project which might lead to confusion for people wondering what repo with which it is associated.

Maybe just a message saying something like "The project within the Automate UI will be named my_A_project -- please confirm that this is what you want.".

from delivery-cli.

afiune avatar afiune commented on August 22, 2024

That sounds reasonable.. So @tonyflint something like this? 😺

➜  my_A_project git:(master) delivery init --github org --repo-name my_B_project
Chef Delivery
Loading configuration from /Users/salimafiune/chef/delivery/organizations/sandbox/my_A_project
WARN: The project within the Automate UI will be named my_A_project.
Press Enter to confirm that this is what you want or Ctr+C to abort.^C

from delivery-cli.

TonyLovesDevOps avatar TonyLovesDevOps commented on August 22, 2024

👍 👍 👍 👍 👍 👍 👍 👍 👍

from delivery-cli.

afiune avatar afiune commented on August 22, 2024

Change had some feedback from the Team.

The final message will be the following:

If the answer is "n"

➜  project_A git:(maste) delivery init --github org --repo-name project_B
Chef Delivery
Loading configuration from /Users/salimafiune/chef/delivery/organizations/sandbox/project_A
WARN: This project will be named 'project_A', but the repository name is 'project_B'.
Are you sure this is what you want? y/n: n
Project and repository name mismatch.

To match the project and the repository name you can:
  1) Create a directory with the same name as the repository.
  2) Clone or download the content of the repository inside.
  3) Run the 'delivery init' command within the new directory.

If the answer is "y" it will continue with the project initialization.

from delivery-cli.

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.