Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
git demo snap update - Bug 1595229 #593
Conversation
stub42
added some commits
Jun 22, 2016
snappy-m-o
commented
Jun 22, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Jun 22, 2016
|
Can one of the admins verify this patch? |
elopio
reviewed
Jun 24, 2016
| @@ -14,3 +14,4 @@ dist | ||
| htmlcov | ||
| __pycache__ | ||
| docs/**.html | ||
| +*~ |
elopio
reviewed
Jun 24, 2016
| +snap connect git:home ubuntu-core:home | ||
| +``` | ||
| + | ||
| +Only access the home directory is granted. You can see this containment |
elopio
Jun 24, 2016
Member
*Only access TO the home ...
I think we should explain the type of access. From snapd's docs: Can access non-hidden files in user's $HOME to read/write/lock.
stub42
Jun 24, 2016
Fixed the grammar. I didn't explain about hidden files as I don't know what snappy considers hidden files - dotfiles seem to work just fine.
elopio
reviewed
Jun 24, 2016
| +fatal: Could not change back to '/tmp/foo': No such file or directory | ||
| +``` | ||
| + | ||
| +Files repositories in your home directory work fine: |
elopio
Jun 24, 2016
Member
there's an error here, but I'm not sure what you were trying to say.
Maybe: Initializing repositories in your...
elopio
reviewed
Jun 24, 2016
| +Files repositories in your home directory work fine: | ||
| +```sh | ||
| +$ mkdir -p ~/tmp/foo | ||
| +$ cd ~/tmp/foo |
elopio
Jun 24, 2016
Member
I think it would be a nice touch to use $HOME instead of ~. Don't you think?
elopio
reviewed
Jun 24, 2016
| +$ mkdir -p ~/tmp/foo | ||
| +$ cd ~/tmp/foo | ||
| +$ /snap/bin/git init | ||
| +Initialized empty Git repository in /home/stub/tmp/foo/.git/ |
elopio
reviewed
Jun 24, 2016
| command: bin/git | ||
| + # git will now have access to files outside of its containment | ||
| + # until you run the following command after installing the snap: | ||
| + # snap connect git:home ubuntu-core:home |
elopio
Jun 24, 2016
Member
What about:
git will have access to files in the user's home directory when you run ...
stub42
Jun 24, 2016
I like emphasising access is contained by default. Requiring users to manually connect the home interface is a security measure and not a meaningless chore. I'm extended the text a bit to make things clearer.
|
I like this. I would like to get @didrocks to look at it, because maybe in his plans for the tour and the website there's an explanation of the home interface. In that case we could get rid of this demo, and move everything you wrote to the tour. If it's not in his short-term plans, lets land this one. And this is missing a test. Take a look at the ones in snaps_tests/demos_tests and see how we can run the connect command, and then verify that the snap is working. Let me know if you need a hand with this. |
snappy-m-o
commented
Jun 24, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Jun 24, 2016
|
Can one of the admins verify this patch? |
|
Agreed with Leo, this demo is becoming redondant once the tour/documentation will talk more about plugs. However, this isn't going to be released short term, so +1 on shipping something like this. |
stub42
added some commits
Jun 24, 2016
|
retest this please |
snappy-m-o
commented
Jun 24, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Jun 24, 2016
|
Can one of the admins verify this patch? |
elopio
reviewed
Jun 24, 2016
| + 'git:home', 'ubuntu-core:home']) | ||
| + self.assertTrue( | ||
| + self.snappy_testbed.run_command(['/snap/bin/git', | ||
| + '--version']).startswith('git')) |
elopio
Jun 24, 2016
•
Member
Thanks for adding the test!
But I was thinking that you could do something like:
self.snappy_testbed.run_command(['mkdir', '-p', '$HOME/tmp/foo'])
self.snappy_testbed.run_command(['/snap/bin/git', 'init', '$HOME/tmp/foo'])
This might need some more work on the run helpers. I'm around to help.
Also, now that this is more extensively tested, would you mind removing the scenario in snaps_tests/demos/tests.py?
stub42
added some commits
Jun 27, 2016
stub42
commented
Jun 27, 2016
•
|
Confirming that the 'home' interface does what it claims does not need to be part of this test, so I'd rather leave it like it is than pollute $HOME with temp directories. Or is this sandboxed somehow and I don't have to worry about cleaning up $HOME safely and reliably? I have removed the redundant test in snaps_tests/demos/tests.py |
stub42
closed this
Jun 27, 2016
stub42
reopened this
Jun 27, 2016
snappy-m-o
commented
Jun 27, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Jun 27, 2016
|
Can one of the admins verify this patch? |
|
The home is not sandboxed. You would have to rm anything you put in there to leave it clean. I will leave you my |
snappy-m-o
commented
Jul 5, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Jul 5, 2016
|
Can one of the admins verify this patch? |
stub42
commented
Jul 5, 2016
|
The test seems to be legitimately failing, and I haven't got them running locally yet to debug. |
|
Can you please resolve the conflict so we can take a look at the failing test? |
snappy-m-o
commented
Aug 3, 2016
|
Can one of the admins verify this patch? |
snappy-m-o
commented
Aug 3, 2016
|
Can one of the admins verify this patch? |
|
There seems to be little activity here. I'll go ahead and close this for now-- feel free to reopen once it's ready to progress. |
stub42 commentedJun 22, 2016
Addresses https://bugs.launchpad.net/snapcraft/+bug/1595229
Adds the 'home' plug to the snap and documentation on how to use it.