It is kind of annoying that the project maintainer has to put in this link, since project* has enough information to generate this automatically, in many cases (ie. the cvs directory and the viewcvs URL from the repository setup form).

However, there are some caveats:

  1. ViewCVS is really old, and AFAIK no longer officially supported. The new project is ViewVC, which as I understand it works better with other version control systems. I have never used ViewCVS, only ViewVC, and I'm not sure if the two programs work in the same way or not with respect to how we would generate URLs for the repository.
  2. CVS and SVN handle tags and branches differently. So if we were to automatically generate a URL for the repository, I think we would want to think about where we would have the url point to. For CVS this might not be a problem, since tags and branches aren't really a separate location, but on SVN there are different directories for trunk, tags, and branches. Since ViewVC works well with subversion repositories, and since I'm using subversion on the site I'm building, I care about this more than others might.
  3. Some sites might provide CVS or SVN hosting, but may be fine with users hosting their project on their own repository or some other location. So I think we want to make it possible for a project maintainer to edit this link directly.

I'm not sure what the best way is to get around these issues. For the case of d.o, the solution might not be that complicated. However, I think we should try to stop putting code in project* that is d.o specific--there's already quite a lot of it, and it makes it tricky for people to use on non d.o sites. Furthermore, since I'm using this on my site, I have less interest in writing a d.o specific patch and instead would plan on making this more generally applicable to other sites as well.

So, any ideas on the best way to do this?

AC

Comments

dww’s picture

a) no need to hard-code for a specific VC viewer. there should just be a setting.

b) cvs.module already has such a setting, so that the auto-generated links in the CVS log viewing stuff works (e.g. the links to diffs, etc).

c) this really should be in cvs.module (or, more correctly, the vc_project.module once jpetso is done), not in project. cvs.module should just extend the project node and add the cvs-specific stuff, instead of having project* do conditional checks for what vc-related module(s) is/are enabled.

d) i agree we could still allow people to edit it, but just have it default to the auto-generated link.

e) perhaps we could even re-use the existing settings in cvs.module for interfacing with the viewer? if not, we should just add another similar setting to the same form that works the same way.

f) needless to say, not every project is integrated with a cvs directory, so we should only generate this link if it's configured as such (just like the cvs access tab, etc, etc). whatever we do should be wrapped in that same helper function we recently added. ;) and, eventually, not every project on the site will be integrated with the same VC system. i could imagine sites hosting lots of projects where some are in CVS, others SVN, others git, etc. project* shouldn't care. that's up to the VC-specific backends to the vc_api.module to worry about...

g) d.o-specific code has no place in project*. i've been trying hard to erradicate it, whenever possible. i'll probably be creating a drupalorg.module in contrib in the near future to start explicitly moving any remaining d.o-specific stuff into. you have my full support for avoiding d.o-specific hacks. at long last, there's becoming a critical mass of project* users (jquery.com, you, me, etc) that aren't d.o. let's keep it that way, and keep expanding that user community to get more folks involved in development.

thanks,
-derek

aclight’s picture

I'm not quite sure how to go about creating the UI for doing this.

I've added 2 new fields to the {cvs_repositories} table:

  • webroot stores the base URL for the web based repository browsing (eg. ViewCVS)
  • webroot_override determines whether project maintainers can override the value for CVS tree that will automatically be created from the webroot and the project's repository directory and shortname

I've added these two settings into cvs_repository_form under their own fieldset called cvs_browser.

Assuming this sounds good so far, how should we handle this in the project_project edit form?

For new projects, we need to know the repository, directory, and shortname first before we can create the cvstree value. Should we even have the setting on the form for a new project? Should we show the user the automatically created value after they submit the project form (sort of like what happens with project_release nodes)?

For projects that are being edited, we can of course have cvstree filled out. But what if the user changes the repository, directory, or shortname? Do we recalculate cvstree? How do we keep from overwriting a value the user has manually entered and maybe doesn't want changed?

Because most of these changes will go into cvs.module, and since I'm already using a forked version of cvs.module, creating patches is a pain. So I'll hold off on writing too much for this until we agree on how this should be handled in the first place.

AC

gábor hojtsy’s picture

I am all for autogenerating this link. I did go in and added such missing links to some projects, so next time I did not need to guess ;)

sun’s picture

sun’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

Aforementioned issue contains a patch specific to drupal.org now.

marvil07’s picture

I think this is related with versioncontrol issue: #354509: Make repository URL backends pluggable

dww’s picture

Project: Project » CVS integration
Component: Projects » User interface

As I mentioned in #1.C, this should be fixed in cvs.module, not project (nor drupalorg). About to mark #435528: Display link to drupalcode.org repository for "Browse the CVS repository" by default duplicate with this.

sun’s picture

Status: Active » Needs work
StatusFileSize
new1.04 KB

@dww: My point in the other issue was that this default is specific to drupal.org. I'm not sure whether it really makes sense for every site in the wild using project/cvslog. Additionally, it would be quite a challenge to make this user- or admin-configurable, as that would involve to fiddle with quite ugly token replacement, and finding a usable UX at the right location to make it configurable in the first place.

So in essence, I heavily disagree with this decision, as the other patch is ready and was a 5 minute job to get completely right. The functionality cannot be added as is to cvslog, because it would have to be configurable, so it works for all users of the module, not only drupal.org. But for this patch, I don't care and didn't even think about other installations, and I don't see a feature request unrelated to drupal.org by other users, so effectively we are talking about adding a configurable feature to cvslog module that no one asked for. We badly need this on drupal.org only.

avpaderno’s picture

Title: automatically generate the value of 'Link to webcvs/viewcvs' field for a project » Automatically generate the value of 'Link to webcvs/viewcvs' field for a project
dww’s picture

@sun: It's easy to add this as a configuration option when you're configuring the CVS repositories. We already have settings like this for making the diff links on pages like http://drupal.org/cvs?commit=422328 work. We just need another a similar setting for this feature.

It does make sense for anyone running project with cvslog that if cvslog knows about a CVS repository for a project that it could fill in this link automatically. It's stupid legacy code from ~8 years ago that has a custom field in project.module for this. I want to rip that field out of project.module and having this just done automatically by cvs.module makes sense. And of course, it'll be handled by versioncontrol API when we kill cvs.module. My main point is that I want to try to completely remove any hard-coded CVS special-cases in either project* or drupalorg to make it easier to move to Git, not add more of them.

I'm sorry I only saw your efforts in the other issue yesterday and how long you've been trying to get this done. I understand it's frustrating. But it's always a balance between getting things done quickly and getting them done right.

Thanks,
-Derek

dww’s picture

Project: CVS integration » Version Control / Project* integration
Version: 6.x-1.x-dev » 6.x-2.x-dev

Yeah, screw it. Let's solve this for real in versioncontrol_project and let's hack it for now on d.o. I reopened #435528.

marvil07’s picture

Status: Needs work » Closed (duplicate)
Issue tags: +git phase 2

Until now the way to show logs on vcs api lives on main versioncontrol module, so I am marking this as duplicate in favour of #156118: Automatically generate the value of 'Link to webcvs/viewcvs' field for a project and #354509: Make repository URL backends pluggable

marvil07’s picture

Project: Version Control / Project* integration » Version Control API
Component: User interface » Commit Log

forgot to change the project

dww’s picture

Status: Closed (duplicate) » Needs work

I'm confused. In #12 this was marked duplicate with itself...

marvil07’s picture

Status: Needs work » Closed (duplicate)

Re #14: You are completely right, blame on me :-p

I tried to mean #976148: Recover links to VCS web viewers and issue tracker at views.

dww’s picture

Project: Version Control API » Version Control / Project* integration
Component: Commit Log » User interface
Status: Closed (duplicate) » Needs work

Sorry, I finally got around to reading what marvil07 is talking about in the linked issues. You misunderstand what this issue is for. We're not talking about commit logs. We're talking about the "Browse the CVS repository" link in the "Development" block on project nodes, e.g. at http://drupal.org/project/project -- if vc_project knows what repo your project is connected to, and VCAPI knows about web viewers, we should be able to generate those links automatically. Which needs to happen. Outside of views. See what I mean? ;)

sdboyer’s picture

Ah yeah - it's a related problem (they'll both rely on the same basic interface in VCAPI), but this'll access it directly, not pass through views.

sdboyer’s picture

Issue tags: +git sprint 8

This'll be really simple to do...once we implement #354509: Make repository URL backends pluggable, which is at the tippy-top of the sprint 8 priority list.

marvil07’s picture

Assigned: Unassigned » marvil07
Status: Needs work » Postponed

Hope to post something here after #354509: Make repository URL backends pluggable is fixed.

marvil07’s picture

Assigned: marvil07 » Unassigned
Status: Postponed » Active

I do not really see the "Development block" at the code, so, now that #354509: Make repository URL backends pluggable is committed, I can provide the ay to get that URL:

// $repository is a VersioncontrolRepository object
$link = $repository->getUrlHandler()->getRepositoryViewUrl();

:-)

Un-assigning for now, I think the block itself is going to be easier to implement for this module maintainers, if not I can take it again.

mikey_p’s picture

This may be better off against drupalorg module where this is currently handled, but I'll try to take a look at this today.

dww’s picture

I'd rather we did it in vc_project than drupalorg if possible. Thanks!

mikey_p’s picture

Assigned: Unassigned » mikey_p
Status: Active » Needs review
StatusFileSize
new2.46 KB

Here's an auto version that uses a sitewide setting from versioncontrol_project for the base_url. This is working well for me locally in combination with #1026110: Add URL plugin for git.drupal.org customizations.

mikey_p’s picture

Status: Needs review » Fixed
StatusFileSize
new899 bytes

I decided to remove the setting and let this just pull from $repo->data['base_url'] so if that's not set this won't work, otherwise, this works great.

I'm going to go ahead and commit the attached patch.

dww’s picture

Status: Fixed » Needs work

#24 assumes every project has a repo. Seems like we need to wrap that in a if (!empty($node->versioncontrol_project['repo']))...

mikey_p’s picture

Status: Needs work » Fixed

Thanks, I committed a small followup.

Status: Fixed » Closed (fixed)
Issue tags: -git phase 2, -git sprint 8

Automatically closed -- issue fixed for 2 weeks with no activity.