You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/08/18 05:54:13 UTC

[buildstream] branch tristan/bst-1/check-permission-denied updated (3ec7cda5b -> 74d851127)

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a change to branch tristan/bst-1/check-permission-denied
in repository https://gitbox.apache.org/repos/asf/buildstream.git


 discard 3ec7cda5b _artifactcache/cascache.py: Check for permission denied when initializing remote
     new 74d851127 _artifactcache/cascache.py: Check for permission denied when initializing remote

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3ec7cda5b)
            \
             N -- N -- N   refs/heads/tristan/bst-1/check-permission-denied (74d851127)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[buildstream] 01/01: _artifactcache/cascache.py: Check for permission denied when initializing remote

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/bst-1/check-permission-denied
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 74d85112703b630292426787d11c1eb9726fefe3
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Thu Aug 18 14:48:58 2022 +0900

    _artifactcache/cascache.py: Check for permission denied when initializing remote
    
    When we check whether the remote supports PushDirectory() requests, we were
    ignoring the possible permission denied.
    
    These checks are made for compatibility with servers, some REAPI requests
    are more efficient but not always supported, if they are not supported we
    fallback to more inefficient codepaths. When checking push related APIs
    we should also ignore errors related to lack of permission.
    
    Fixes #1724
---
 buildstream/_artifactcache/cascache.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 50b0b9ef4..2e4636d45 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -1154,7 +1154,8 @@ class CASRemote():
                 if e.code() == grpc.StatusCode.INVALID_ARGUMENT:
                     # Expected error as the request doesn't specify any URIs.
                     self.asset_push_supported = True
-                elif e.code() != grpc.StatusCode.UNIMPLEMENTED:
+                if (e.code() != grpc.StatusCode.UNIMPLEMENTED and
+                        e.code() != grpc.StatusCode.PERMISSION_DENIED):
                     raise
 
             self._initialized = True