{"action":"created","issue":{"url":"https://api.github.com/repos/salsaflow/salsaflow/issues/63","labels_url":"https://api.github.com/repos/salsaflow/salsaflow/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/salsaflow/salsaflow/issues/63/comments","events_url":"https://api.github.com/repos/salsaflow/salsaflow/issues/63/events","html_url":"https://github.com/salsaflow/salsaflow/issues/63","id":106943103,"number":63,"title":"Review story SF-220: Implement a dialog for `repo bootstrap`","user":{"login":"tchap","id":697127,"avatar_url":"https://avatars.githubusercontent.com/u/697127?v=3","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/salsaflow/salsaflow/labels/review","name":"review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"mbernat","id":643552,"avatar_url":"https://avatars.githubusercontent.com/u/643552?v=3","gravatar_id":"","url":"https://api.github.com/users/mbernat","html_url":"https://github.com/mbernat","followers_url":"https://api.github.com/users/mbernat/followers","following_url":"https://api.github.com/users/mbernat/following{/other_user}","gists_url":"https://api.github.com/users/mbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/mbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbernat/subscriptions","organizations_url":"https://api.github.com/users/mbernat/orgs","repos_url":"https://api.github.com/users/mbernat/repos","events_url":"https://api.github.com/users/mbernat/events{/privacy}","received_events_url":"https://api.github.com/users/mbernat/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/salsaflow/salsaflow/milestones/10","html_url":"https://github.com/salsaflow/salsaflow/milestones/0.16.0-review","labels_url":"https://api.github.com/repos/salsaflow/salsaflow/milestones/10/labels","id":1286655,"number":10,"title":"0.16.0-review","description":null,"creator":{"login":"tchap","id":697127,"avatar_url":"https://avatars.githubusercontent.com/u/697127?v=3","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-09-02T15:54:04Z","updated_at":"2015-09-17T09:15:17Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-09-17T09:15:17Z","updated_at":"2015-09-17T10:43:51Z","closed_at":null,"body":"Story being reviewed: [SF-220](https://jira.salsitasoft.com/browse/SF-220)\n\nSF-Issue-Tracker: JIRA\nSF-Story-Key: SF-220\n\nThe commits to be reviewed are following:\n- [ ] 66e5492: prompt: Refactor the package\n- [ ] fb8f078: config: Refactor the package\n- [ ] 491382d: config/loader: Introduce a new config loading pkg\n- [ ] b25e9b9: pkg: Align to the latest config management changes\n- [ ] 0adb883: git: Align to the latest config management changes\n- [ ] 59219b4: version: Align to the config management changes\n- [ ] a3b689c: repo: Align to the config management changes\n- [ ] 770f85a: modules/common: Align to the config changes\n- [ ] baf4420: modules: Rewrite modules loading logic\n- [ ] 03badbc: modules/pivotaltracker: Refactor config\n- [ ] 0c64401: modules/jira: Refactor config\n- [ ] da1e6e5: modules/reviewboard: Refactor config\n- [ ] 64b77f3: modules/github/codereview: Refactor config\n- [ ] 259d59e: modules/github/releasenotes: Refactor config\n- [ ] f88d444: repo bootstrap: Rewrite to use the new config loader\n\nThe following review blockers were opened by the reviewer:\n- [ ] [blocker 1](https://github.com/salsaflow/salsaflow/commit/f88d44409e4c72113706119de65cfd974f9e6b85#commitcomment-13281945) (commit f88d44409e4c72113706119de65cfd974f9e6b85): Update README and docs\n- [ ] [blocker 2](https://github.com/salsaflow/salsaflow/commit/491382ddaaf8e47f7f1578a48585ebf8cbbb2e87#commitcomment-13282924) (commit 491382ddaaf8e47f7f1578a48585ebf8cbbb2e87): Put some comments in the code to document the interfaces.\n- [ ] [blocker 3](https://github.com/salsaflow/salsaflow/commit/b25e9b97459903d4e7fdb4dfd8ab1709ab42d632#commitcomment-13282996) (commit b25e9b97459903d4e7fdb4dfd8ab1709ab42d632): Use `prompt.Dialog` for this. There is the `secret` parameter now that can be used for this.\n- [ ] [blocker 4](https://github.com/salsaflow/salsaflow/commit/03badbcc4b105a155982d97b5f7858d173c16357#commitcomment-13283509) (commit 03badbcc4b105a155982d97b5f7858d173c16357): Use `prompt.Dialog`\n- [ ] [blocker 5](https://github.com/salsaflow/salsaflow/commit/03badbcc4b105a155982d97b5f7858d173c16357#commitcomment-13283546) (commit 03badbcc4b105a155982d97b5f7858d173c16357): This is not too pretty, forgot to refactor. Also, make sure there are no duplicate labels.\n\n----------\n\nThe config handling has completely changed, as well as the bootstrapping process.\n\nConsidering the config handling, any package that needs to read config from either local or global config file need to provide a specification in form of `loader.ConfigSpec` interface. This object is passed to `loader.LoadConfig`. There is no config object returned from the call, the idea is that the spec is filled during `LoadConfig` and the package then uses the filled data. Check the `ConfigSpec` interface to understand better.\n\n`ConfigSpec` interface is actually designed to handle both config bootstrapping and loading. The bootstrapping part (`PromptUserForConfig`) is used during `repo bootstrap` and also when it is not possible to unmarshal the config or the given config section is invalid.\n\nFor the config files themselves, we are moving from YAML to JSON. This is because JSON allows for better deferred unmarshalling and pre-marshalling. Also both files contain a configuration section stores under `configuration` key. This section contains a map of `config key -> config section`. Every package wishing to store config needs to provide the key and the given ConfigSpec handles custom (un)marshalling when needed, so the loader itself doesn't need to know anything about the config section structure for the given package/spec.\n\nConsidering the loader package, there are basically 3 ways how to use it:\n\n* Use `LoadConfig` to load a config for the given spec. This returns an error when the local config section is not present/valid, in other words, this function never modified the local config file. This is to prevent SF from modifying the local config when the user is doing something. And also this should not be ever needed, the local config is generated during `repo bootstrap`. And in case there is a change needed, it should be handled manually, not during like `review post` or something.\n* Use `BootstrapConfig` to do the same stuff as `LoadConfig`, but also to allow for local config dialog to be run.\n* Use `RegisterBootstrapConfigSpec` to register a ConfigSpec to be bootstrapped when `RunCommonBootstrapDialog` is run. The function is used to register specs for various packages that need some config bootstrapping, e.g `git` and `version`. The dialog is run during `repo bootstrap`.\n* All modules must supply a ConfigSpec, which is automatically used during `repo bootstrap`. And the modules use the same spec internally as well with `LoadConfig` when they are actually instantiated.\n\nTo understand how the bootstrapping actually looks like, a `repo bootstrap` output follows:\n\n```\n$ salsaflow repo bootstrap\n\n-----> Configuring 'salsaflow.core.git' (local configuration)\n\nJust press Enter to use the default value (if available).\n\nInsert the trunk branch name (default = develop):\nInsert the release branch name (default = release):\nInsert the staging branch name (default = stage):\nInsert the stable branch name (default = master):\n\n[WARN]     Local configuration file modified, please commit it.\n\n-----> Done\n\n-----> Configuring 'salsaflow.core.versioning' (local configuration)\n\nJust press Enter to use the default value (if available).\n\nInsert the trunk version string suffix (default = dev):\nInsert the testing version string suffix (default = qa):\nInsert the staging version string suffix (default = stage):\n\n[WARN]     Local configuration file modified, please commit it.\n\n-----> Done\n\nPlease select a module for module kind 'issue_tracking':\n\n[1] salsaflow.issuetracking.jira\n[2] salsaflow.issuetracking.pivotaltracker\n\nChoose a module by inserting the associated number.\nLeaving the answer empty will abort the dialog.\n\nYou choice: 1\n\n[LOG]      Configuration section invalid, will run the bootstrap dialog\n(error = configuration record not found for key 'salsaflow.issuetracking.jira')\n\n-----> Configuring 'salsaflow.issuetracking.jira' (global configuration)\n\nInsert the address of the chosen JIRA server: https://jira.salsitasoft.com\n\nChecking available JIRA credentials ...\nMatching JIRA credentials found (username = ondrej.kupka)\n\n-----> Done\n\n-----> Configuring 'salsaflow.issuetracking.jira' (local configuration)\n\n[RUN]      Fetch available JIRA projects\n\nAvailable JIRA projects:\n\n(... filtered ...)\n[4] SalsaFlow (SF)\n(... filtered ...)\n\nChoose the project to associate this repository with.\nProject number: 4\n\n[WARN]     Local configuration file modified, please commit it.\n\n-----> Done\n\nPlease select a module for module kind 'code_review':\n\n[1] salsaflow.codereview.github\n[2] salsaflow.codereview.reviewboard\n\nChoose a module by inserting the associated number.\nLeaving the answer empty will abort the dialog.\n\nYou choice: 1\n\n-----> Configuring 'salsaflow.codereview.github' (local configuration)\n\nJust press Enter to use the default value (if available).\n\nInsert the label to be used to mark the GitHub review issues with (default = review):\nInsert the label to be used to mark the GitHub review issues as implemented (default = implemented):\n\n[WARN]     Local configuration file modified, please commit it.\n\n-----> Done\n\nPlease select a module for module kind 'release_notes':\n\n[1] salsaflow.releasenotes.github\n\nChoose a module by inserting the associated number.\nLeaving the answer empty will abort the dialog.\n\nThis module kind is optional, insert 's' to skip it.\nYou choice: 1\n\n-----> Configuring 'salsaflow.releasenotes.github' (local configuration)\n\nNothing to configure here!\n\n[WARN]     Local configuration file modified, please commit it.\n\n-----> Done\n\n[LOG]      Successfully bootstrapped the repository for SalsaFlow\nDo not forget to commit modified configuration files!\n```\n\nMore detailed explanations of the mechanics will be added as review annotations."},"comment":{"url":"https://api.github.com/repos/salsaflow/salsaflow/issues/comments/141040491","html_url":"https://github.com/salsaflow/salsaflow/issues/63#issuecomment-141040491","issue_url":"https://api.github.com/repos/salsaflow/salsaflow/issues/63","id":141040491,"user":{"login":"tchap","id":697127,"avatar_url":"https://avatars.githubusercontent.com/u/697127?v=3","gravatar_id":"","url":"https://api.github.com/users/tchap","html_url":"https://github.com/tchap","followers_url":"https://api.github.com/users/tchap/followers","following_url":"https://api.github.com/users/tchap/following{/other_user}","gists_url":"https://api.github.com/users/tchap/gists{/gist_id}","starred_url":"https://api.github.com/users/tchap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchap/subscriptions","organizations_url":"https://api.github.com/users/tchap/orgs","repos_url":"https://api.github.com/users/tchap/repos","events_url":"https://api.github.com/users/tchap/events{/privacy}","received_events_url":"https://api.github.com/users/tchap/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T10:43:50Z","updated_at":"2015-09-17T10:43:50Z","body":"@mbernat This is a pretty large change, I hope that you won't feel totally lost at least after reading the intro in the issue description. But in case this is too much, we can go though it personally or something... In any case, feel free to ask ;-) I already opened a few issues for myself, but they are not about any large code changes, so you can start reviewing ;-)"}}