Git Product home page Git Product logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I forgot to mention that sync does work as long as I run on the svn server and 
specify the path. The commits are successfully added to the Bugzilla bug in 
this case. However sync gives the same error as mentioned earlier when 
specifying the server URL.

This works:
perl sync.pl --type=Svn [email protected]  --verbose 
file:///opt/repos/svn/myrepo/

This gives same authentication error as mentioned earlier:
perl sync.pl --type=Svn [email protected]  --verbose 
http://my_host/repos/svn/myrepo

Original comment by [email protected] on 24 Apr 2011 at 5:25

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I don't see how the Subversion credentials ever get passed into the Bugzilla 
VCS.add_commit service so that it can use them when connecting to Subversion.

In lib/VCI/VCS/Svn.pm, the SVN::Client gets created with empty config hash:

sub _build_x_client {
    my $self = shift;
    return SVN::Client->new(config => {});
}

When running the hook.pl script, I can see the access to the Subversion 
repository in the access log file. There is an OPTIONS call that returns http 
code = 401 which fails the hook.pl invocation.


The credentials for the Subversion user reside in the directory:

   $HOME/.subversion//auth/svn.simple

and I can verify that the respective user can access Subversion using the 
standard svn command line client with these credentials. I just don't see where 
the SVN::Client ever gets the credentials.

How can I help Bugzilla to use the correct Subversion credentials so that it 
won't fail?



Original comment by [email protected] on 5 May 2011 at 7:30

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Hey! The authentication feature is actually missing in the underlying VCI 
library from CPAN. However, I'm also the maintainer of that library, so you're 
welcome to send me a patch to it.

Original comment by [email protected] on 6 May 2011 at 6:29

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
[deleted comment]

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024

Original comment by [email protected] on 11 May 2011 at 6:13

Attachments:

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Well after some digging, I located two places where svn authentication was 
involved in the VCI library. I was able to get sync.pl and hook.pl working with 
svn auth.

The 2 modified files were:

--  lib/VCI/VCS/Svn/Repository.pm
--  lib/VCI/VCS/Svn.pm

Note that these are just hacks at this point to put the svn auth into place. 
Credentials could be read in from a file (or maybe the .subversion auth data?) 
- this was just to test out where the auth was needed in the VCI code.

I added an auth hash to the client new like so:

For example in Svn.pm, _build_x_client becomes:

sub _build_x_client {
    my $self = shift;
    return SVN::Client->new(
       auth => [SVN::Client::get_simple_provider(),
                SVN::Client::get_simple_prompt_provider(
                     sub {
                          my $cred = shift;
                          $cred->username("fog");
                          $cred->password("bank");
                     },
                     2
                ),
                SVN::Client::get_username_provider()]);
}

I'm not that sure how to leverage the .subversion auth info though - must be a 
way to read it in, or maybe the svn driver can already do this?



Original comment by [email protected] on 11 May 2011 at 6:49

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
it seems that without the correct credentials, none will be able to use 
subversion ever again....

Original comment by [email protected] on 11 May 2012 at 6:03

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
Hello Pat,

I got same problem here, it seems VCI library failed to authenticate the 
subversion repository.It ignoring the local svn credentials in the homedir. 
I am not familiar with VCI api,so I got stuck here. I googled it and didn't 
find hint for this issue.

Did you manage to resolve this issue?
Maybe patch?

Thanks,

Assaf R



Original comment by [email protected] on 3 Dec 2012 at 8:43

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
I had to struggle with it.... I had to update the Svn.pm and the 
lib/VCI/VCS/Svn/Repository.pm:

has 'x_ra' => (is => 'ro', isa => 'SVN::Ra', lazy => 1,
               default => sub { SVN::Ra->new(
                                         url => shift->x_root_noslash,
                                         auth =>     [                   SVN::Client::get_simple_provider(),
                                                          SVN::Client::get_simple_prompt_provider
                                                     (
                                                        \&getauth,2
                                                     ),
                                                     SVN::Client::get_username_provider()
                                                  ],

              );
              });






Original comment by [email protected] on 4 Dec 2012 at 3:15

from bugzilla-vcs.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 22, 2024
...also, another important feature missing is the ability to make the "commits" 
private, as comments are.

After digging some more I found it:

edit this file:
./bugzilla/extensions/VCS/template/en/default/hook/bug/edit-after_custom_fields.
html.tmpl

i.e.

   [%IF user.is_insider %]

[% RETURN UNLESS bug.vcs_commits.size %]
<tr id="commits">
  <th class="field_label commits_label">
    <a href="#commits">[% field_descs.vcs_commits FILTER html %]:</a>
  </th>
  <td></td>
</tr>
<tr>
  <td colspan="2">
          <div class="bz_private_checkbox">
            <input type="hidden" value="1"
                   name="defined_isprivate_[% comment.id %]">
          </div>
      [% PROCESS "vcs/commits.html.tmpl" %]
     </div>
   </td>
</tr>
   [% END %]


I hope I earned my two cents...   ;)

Assaf


Original comment by [email protected] on 4 Dec 2012 at 3:21

from bugzilla-vcs.

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.