Comments (7)
@tonyflint my good friend!
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.
@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.
@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.
@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.
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.
from delivery-cli.
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)
- Delivery local mode no longer pulls remote files.
- rename to `automate-cli` HOT 1
- delivery local lint works but automate server lint fails
- delivery local should have the ability to leverage build cookbook HOT 1
- delivery local should have the ability to leverage build cookbook HOT 2
- delivery review claims to fail to push branch to BitBucket repo HOT 2
- delivery doesn't recognize review --user HOT 3
- delivery's cli.toml has no dynamism for user HOT 3
- Replace `--auto-bump` with `--bump [ patch | minor | major ]` HOT 2
- Find .delivery config even when traversing symlinks HOT 2
- Delivery review does not respect cli toml when changing server. HOT 3
- delivery setup fails if terminal does not support colors. HOT 1
- Root dir and project path not correct for git submodules
- local does not skip `functional` when commented out HOT 6
- It would be useful to be able to control the logging level of the chef-client run used during an automate job HOT 1
- Unable to run delivery init successfully HOT 1
- Delivery local mode fails without a git config
- Delivery local mode does not work as expected in mono repos
- Agent Output on Windows introduces errors for git porcelain parsing
- Enable failing cucumber tests inside the pipeline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delivery-cli.