Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11436 closed defect (fixed)

cannot create a new hack

Reported by: ryepup Owned by: Ryan J Ollos
Priority: normal Component: TracHacks
Severity: normal Keywords:
Cc: Jun Omae Trac Release:

Description

I'm trying to add a new plugin, following instructions on HackProcedures.

I'm stuck at "fill out the NewHack form". When I load that page, all I see a grey link:

NewHack(NewHackTemplate)?

When I follow it, the next page says:

The page NewHack(NewHackTemplate) does not exist. You can create it here.

How do I fill in the NewHack form?

Attachments (0)

Change History (21)

comment:1 Changed 4 years ago by Ryan J Ollos

Owner: changed from Michael Renzmann to Ryan J Ollos
Status: newassigned

It is currently offline, and being discussed in #10193. It looks like we may have a working version now, so I will test tomorrow and try to get it installed.

comment:2 Changed 4 years ago by Ryan J Ollos

Cc: Jun Omae added; anonymous removed

Presently investigating the following issue when trying to create a hack (paths in log message have been redacted and made relative):

2013-12-18 23:08:18,810 Trac[web_ui] ERROR: Failed to create Subversion paths:
svn: Local, non-commit operations do not take a log message or revision properties
Traceback (most recent call last):
  File "... pve/lib/python2.6/site-packages/TracHacks-3.0dev_r13483-py2.6.egg/trachacks/web_ui.py", line 450, in create_hack
    selected_releases)
  File "... pve/lib/python2.6/site-packages/TracHacks-3.0dev_r13483-py2.6.egg/trachacks/web_ui.py", line 536, in _create_repository_paths
    (stdout, stderr))
Exception: Failed to create Subversion paths:
svn: Local, non-commit operations do not take a log message or revision properties

2013-12-18 23:08:18,814 Trac[main] WARNING: [50.204.77.146] HTTPInternalError: 500 Trac Error (Failed to create Subversion paths:
svn: Local, non-commit operations do not take a log message or revision properties
)

comment:3 Changed 4 years ago by Ryan J Ollos

Ah, I guess I need to set TRACHACKS_SVN_CONFIG_DIR in the environment.

comment:4 Changed 4 years ago by Ryan J Ollos

It looks like issue is due to default repository being configured in database rather than in trac.ini. The following patch fixes the issue, but there must be a cleaner way to implement the change:

  • trachacks/web_ui.py

    diff --git a/trachacks/web_ui.py b/trachacks/web_ui.py
    index cb277d3..83d7ff5 100644
    a b from trac.wiki.macros import WikiMacroBase 
    2424from trac.wiki.model import WikiPage
    2525from trac.util.compat import sorted
    2626from trac.util.translation import tag_
     27from trac.versioncontrol.api import RepositoryManager
    2728from trac.web.api import (
    2829    IRequestFilter, IRequestHandler, ITemplateStreamFilter, RequestDone
    2930)
    class TracHacksHandler(Component): 
    514515
    515516        env = os.environ.copy()
    516517        env['LC_ALL'] = env['LANG'] = 'en_US.UTF-8'
    517         svn_path = 'file://%s' % self.config.get('trac', 'repository_dir')
     518        rm = RepositoryManager(self.env)
     519        repos = rm.get_all_repositories()['']
     520        svn_path = 'file://%s' % repos['dir']
    518521        svn_path = svn_path.rstrip('/')
    519522        paths = ['%s/%s' % (svn_path, hack_path)]
    520523        paths.extend('%s/%s/%s' % (svn_path, hack_path, release)

I think that, ideally we'd have a configuration variable [trachacks] hacks_repository, which would determine the repository that is retrieved. We could probably use the url from the database as well, and drop the [trachacks] subversion_base_url configuration option.

comment:5 in reply to:  4 Changed 4 years ago by Jun Omae

Replying to rjollos:

It looks like issue is due to default repository being configured in database rather than in trac.ini. The following patch fixes the issue, but there must be a cleaner way to implement the change:

We can use self.env.get_repository() to retrieve the default repository.

I think that, ideally we'd have a configuration variable [trachacks] hacks_repository, which would determine the repository that is retrieved. We could probably use the url from the database as well, and drop the [trachacks] subversion_base_url configuration option.

That sounds good.

Proposed changes in https://github.com/jun66j5/trachacksplugin/compare/t11436.

Last edited 4 years ago by Jun Omae (previous) (diff)

comment:6 Changed 4 years ago by Ryan J Ollos

In 13488:

Fixed error for default repository defined in a DbRepositoryProvider rather than trac.ini. Refs #11436. Patch by Jun Omae.

  • Retrieve the default repository using Environment.get_repository() rather than trac.ini
  • Retrieve url of the new hack using Repository.get_path_url() and removed [trachacks] subversion_base_url option

comment:7 Changed 4 years ago by Ryan J Ollos

TracHacksPlugin at r13488 is installed on t-h.o and it seems to be working well. Thanks so much Jun!

It won't be available to all users until grant HACK_CREATE permission. Jun, would you like to try publishing your latest hack before we reveal the NewHack page to all users?

comment:8 Changed 4 years ago by Jun Omae

Thanks! Oh, I'd like to try to publishing.

comment:9 in reply to:  8 Changed 4 years ago by Jun Omae

Thanks! Oh, I'd like to try to publishing.

... I cannot access new hack page. That seems I have no HACK_CREATE permission. Could you please grant it to me?

comment:10 Changed 4 years ago by Ryan J Ollos

Sorry about that. You should have the permission now.

comment:11 Changed 4 years ago by Jun Omae

I registered new hacks. Then, I found two issues.

  • Ignore Installation instructions in the form.
  • The hack type and author name automatically are not tagged.
Version 0, edited 4 years ago by Jun Omae (next)

comment:12 in reply to:  11 ; Changed 4 years ago by Jun Omae

I registered new hacks. Then, I found two issues.

  • Ignore Installation instructions in the form.
  • The hack type and author name automatically are not tagged.

Proposed changes in https://github.com/jun66j5/trachacksplugin/compare/t11436.1.

Also, the following should be applied to NewHackTemplate.

  • NewHackTemplate

    old new  
    2222
    2323You can check out ${WIKINAME} from [${SOURCEURL} here] using Subversion, or [source:${LCNAME} browse the source] with Trac.
    2424
    25 == Example ==
     25== Installation ==
    2626
    27 ${EXAMPLE}
     27${INSTALLATION}
    2828
    2929== Recent Changes ==
    3030

comment:13 Changed 4 years ago by Ryan J Ollos

In 13507:

Pass "installation" parameter to template data. Append author name to tags. Refs #11436.

Patch by Jun Omae.

comment:14 Changed 4 years ago by Ryan J Ollos

In 13508:

Fixed invalid value for -moz-background-clip property. Refs #11436.

comment:15 Changed 4 years ago by Ryan J Ollos

In 13509:

Moved macros to macros.py and utility functions to util.py. Refs #11436.

comment:16 in reply to:  14 Changed 4 years ago by Jun Omae

In 13508:

Fixed invalid value for -moz-background-clip property. Refs #11436.

That seems we could remove those properties from #preview. According to https://developer.mozilla.org/en-US/docs/Web/CSS, initial values are specified in #preview.

property name initial value
background-clip border-box
-moz-background-inline-policy continuous
background-origin padding-box

comment:17 Changed 4 years ago by Ryan J Ollos

In 13511:

Remove rules for which the initial value is specified. Refs #11436.

Patch by Jun Omae.

comment:18 in reply to:  12 Changed 4 years ago by Ryan J Ollos

Replying to jun66j5:

Also, the following should be applied to NewHackTemplate.

Edited in wiki:/NewHackTemplate?action=diff&version=26.

comment:19 Changed 4 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

r13509 has been deployed to trac-hacks.org and authenticated users now have the HACK_CREATE permission.

ryepup: You should be able to create a hack now.

Posted some news:

comment:20 Changed 4 years ago by Jun Omae

Thanks, Ryan!

BTW, NewHack wiki page is still existent. I think we should remove the page or make a newhack link in the page. I cannot modify the page which is read only.

comment:21 in reply to:  20 Changed 4 years ago by Ryan J Ollos

Replying to jun66j5:

BTW, NewHack wiki page is still existent. I think we should remove the page or make a newhack link in the page. I cannot modify the page which is read only.

Thanks, I added a redirect there just now.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.