[Trac] Re: ticket-workflow-notifications

2017-08-10 Thread mickeyf
Sorry, but where do I find version 0.6?

On Tuesday, August 1, 2017 at 2:31:50 PM UTC-7, mickeyf wrote:
>
> I have tried to install and test this, but so far no joy. I'm not even 
> sure it has installed correctly. I am not up to speed on how things are 
> generally done in Python. I was not able to find an egg, but only the 
> zipped/tar'd code on git-hub. Not having clear direction on how to proceed, 
> I ran the setup.py, which did not show any complains or errors. I copied 
> the workflow_notification folder into /web/trac/plugins. My trac.ini 
> contains very nearly the example code shown on the trac hacks page:
>
> [ticket]
> ... other stuff
> workflow = ConfigurableTicketWorkflow, TicketWorkflowNotifier
>
>
>  [ticket-workflow-notifications]
> when_fixed = resolve
> when_fixed.body = Ticket ${ticket.id} has been fixed! View it here: 
> ${link}
> when_fixed.subject = Ticket ${ticket.id} is fixed!
> when_fixed.recipients = myem...@realaddress.com
> when_fixed.condition = ${ticket.resolution == 'fixed'}
>
>
> Is there a straightforward way to first test that this is actually 
> installed, and then to troubleshoot it? I have tried setting a dummy ticket 
> to 'fixed' but get neither a notification nor an error message.
>
> Thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Introduce the warehouse synchronization documents need to be updated

2017-08-10 Thread Mingxing Tian


在 2017年8月10日星期四 UTC+8上午10:49:15,RjOllos写道:
>
>
>
> On Wednesday, August 9, 2017 at 7:09:10 PM UTC-7, Mingxing Tian wrote:
>>
>>
>>
>> 在 2017年8月10日星期四 UTC+8上午4:34:02,RjOllos写道:
>>>
>>>
>>>
>>> On Tuesday, August 8, 2017 at 7:13:13 PM UTC-7, Mingxing Tian wrote:

 I follow the following document configuration each time you push to the 
 Git repository, insert a change record to the corresponding task order.

 http://trac.idouzi.com/wiki/TracRepositoryAdmin#Git

 In my warehouse hooks do not see the "hooks/post-commit" file, only 
 the following files.

 [root@host105 hooks]# pwd
 /home/git/repositories/testing.git/hooks
 [root@host105 hooks]# ll
 总用量 44
 -rwx-- 1 git git  478 8月   2 11:47 applypatch-msg.sample
 -rwx-- 1 git git  896 8月   2 11:47 commit-msg.sample
 -rwx-- 1 git git  189 8月   9 10:04 post-update.sample
 -rwx-- 1 git git  424 8月   2 11:47 pre-applypatch.sample
 -rwx-- 1 git git 1642 8月   2 11:47 pre-commit.sample
 -rwx-- 1 git git 1239 8月   2 11:47 prepare-commit-msg.sample
 -rwx-- 1 git git 1348 8月   2 11:47 pre-push.sample
 -rwx-- 1 git git 4951 8月   2 11:47 pre-rebase.sample
 -rwx-- 1 git git  544 8月   9 10:02 pre-receive.sample
 lrwxrwxrwx 1 git git   39 8月   2 11:47 update -> 
 /home/git/.gitolite/hooks/common/update
 -rwx-- 1 git git 3610 8月   2 11:47 update.sample
 [root@host105 hooks]#


>>> You'll probably want to use a post-receive hook, as described in:
>>> https://trac.edgewall.org/wiki/TracRepositoryAdmin#Git
>>>
>>> I don't know why the hooks aren't present your repository, but they are 
>>> documented:
>>> https://git-scm.com/docs/githooks#post-receive 
>>>
>>> Maybe the difference has to do with your use of Gitolite?
>>>
>>> $git --version
>>> git version 2.13.3
>>> $git init --bare testing.git
>>> Initialized empty Git repository in ~/testing.git/
>>> $ls -l testing.git/hooks/
>>> total 88
>>> -rwxr-xr-x  1 rjollos  staff   478 Aug  9 13:33 applypatch-msg.sample
>>> -rwxr-xr-x  1 rjollos  staff   896 Aug  9 13:33 commit-msg.sample
>>> -rwxr-xr-x  1 rjollos  staff   189 Aug  9 13:33 post-update.sample
>>> -rwxr-xr-x  1 rjollos  staff   424 Aug  9 13:33 pre-applypatch.sample
>>> -rwxr-xr-x  1 rjollos  staff  1642 Aug  9 13:33 pre-commit.sample
>>> -rwxr-xr-x  1 rjollos  staff  1348 Aug  9 13:33 pre-push.sample
>>> -rwxr-xr-x  1 rjollos  staff  4951 Aug  9 13:33 pre-rebase.sample
>>> -rwxr-xr-x  1 rjollos  staff   544 Aug  9 13:33 pre-receive.sample
>>> -rwxr-xr-x  1 rjollos  staff  1239 Aug  9 13:33 prepare-commit-msg.sample
>>> -rwxr-xr-x  1 rjollos  staff  3610 Aug  9 13:33 update.sample
>>>
>>>
>>> - Ryan
>>>
>>>
>> Sir, I found that you did not list the "post-commit" in the hook, your 
>> structure and I was the same. 
>>
>
> As already stated, you want to use post-receive hook, not post-commit.
>
> - Ryan 
>

 There is no "post-receive" hook, your environment is not, this is the same 
as my situation. But I found "post-update", maybe it could achieve the 
results I wanted. Anyway, your document is up to date.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Re: Introduce the warehouse synchronization documents need to be updated

2017-08-10 Thread Ryan Ollos
On Thu, Aug 10, 2017 at 2:48 AM, Mingxing Tian  wrote:

> I try to create the file "post-receive" and enter the contents of the
> given, of course, modify the value of the above two lines of variables. But
> the result is a failure, this way is not correct.
>

We need to know the exact steps you took and the error messages you
received in order to help you determine what you did incorrectly.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: Introduce the warehouse synchronization documents need to be updated

2017-08-10 Thread RjOllos


On Wednesday, August 9, 2017 at 11:23:02 PM UTC-7, Mingxing Tian wrote:
>
>
>
> 在 2017年8月10日星期四 UTC+8上午10:49:15,RjOllos写道:
>>
>>
>>
>> On Wednesday, August 9, 2017 at 7:09:10 PM UTC-7, Mingxing Tian wrote:
>>>
>>>
>>>
>>> 在 2017年8月10日星期四 UTC+8上午4:34:02,RjOllos写道:



 On Tuesday, August 8, 2017 at 7:13:13 PM UTC-7, Mingxing Tian wrote:
>
> I follow the following document configuration each time you push to 
> the Git repository, insert a change record to the corresponding task 
> order.
>
> http://trac.idouzi.com/wiki/TracRepositoryAdmin#Git
>
> In my warehouse hooks do not see the "hooks/post-commit" file, only 
> the following files.
>
> [root@host105 hooks]# pwd
> /home/git/repositories/testing.git/hooks
> [root@host105 hooks]# ll
> 总用量 44
> -rwx-- 1 git git  478 8月   2 11:47 applypatch-msg.sample
> -rwx-- 1 git git  896 8月   2 11:47 commit-msg.sample
> -rwx-- 1 git git  189 8月   9 10:04 post-update.sample
> -rwx-- 1 git git  424 8月   2 11:47 pre-applypatch.sample
> -rwx-- 1 git git 1642 8月   2 11:47 pre-commit.sample
> -rwx-- 1 git git 1239 8月   2 11:47 prepare-commit-msg.sample
> -rwx-- 1 git git 1348 8月   2 11:47 pre-push.sample
> -rwx-- 1 git git 4951 8月   2 11:47 pre-rebase.sample
> -rwx-- 1 git git  544 8月   9 10:02 pre-receive.sample
> lrwxrwxrwx 1 git git   39 8月   2 11:47 update -> 
> /home/git/.gitolite/hooks/common/update
> -rwx-- 1 git git 3610 8月   2 11:47 update.sample
> [root@host105 hooks]#
>
>
 You'll probably want to use a post-receive hook, as described in:
 https://trac.edgewall.org/wiki/TracRepositoryAdmin#Git

 I don't know why the hooks aren't present your repository, but they are 
 documented:
 https://git-scm.com/docs/githooks#post-receive 

 Maybe the difference has to do with your use of Gitolite?

 $git --version
 git version 2.13.3
 $git init --bare testing.git
 Initialized empty Git repository in ~/testing.git/
 $ls -l testing.git/hooks/
 total 88
 -rwxr-xr-x  1 rjollos  staff   478 Aug  9 13:33 applypatch-msg.sample
 -rwxr-xr-x  1 rjollos  staff   896 Aug  9 13:33 commit-msg.sample
 -rwxr-xr-x  1 rjollos  staff   189 Aug  9 13:33 post-update.sample
 -rwxr-xr-x  1 rjollos  staff   424 Aug  9 13:33 pre-applypatch.sample
 -rwxr-xr-x  1 rjollos  staff  1642 Aug  9 13:33 pre-commit.sample
 -rwxr-xr-x  1 rjollos  staff  1348 Aug  9 13:33 pre-push.sample
 -rwxr-xr-x  1 rjollos  staff  4951 Aug  9 13:33 pre-rebase.sample
 -rwxr-xr-x  1 rjollos  staff   544 Aug  9 13:33 pre-receive.sample
 -rwxr-xr-x  1 rjollos  staff  1239 Aug  9 13:33 
 prepare-commit-msg.sample
 -rwxr-xr-x  1 rjollos  staff  3610 Aug  9 13:33 update.sample


 - Ryan


>>> Sir, I found that you did not list the "post-commit" in the hook, your 
>>> structure and I was the same. 
>>>
>>
>> As already stated, you want to use post-receive hook, not post-commit.
>>
>> - Ryan 
>>
>
>  There is no "post-receive" hook, your environment is not, this is the 
> same as my situation. But I found "post-update", maybe it could achieve the 
> results I wanted. Anyway, your document is up to date.
>

Just create the file and add the content shown in:
https://trac.edgewall.org/wiki/TracRepositoryAdmin#Git

#!/bin/sh
tracenv=/path/to/env # change with your Trac environment's path
repos=   # change with your repository's name
while read oldrev newrev refname; do
if [ "$oldrev" =  ]; then
git rev-list --reverse "$newrev" --
else
git rev-list --reverse "$newrev" "^$oldrev" --
fi | xargs trac-admin "$tracenv" changeset added "$repos"
done


The file just needs to be named post-receive and be executable by the user 
that invokes the hook.

Git adds sample hooks when creating a repository, but they are just 
samples. You can just create the ones that don't exist.

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: ticket-workflow-notifications

2017-08-10 Thread mickeyf
Yes, I reported earlier that the plugin is version 0.5. I will upgrade to 
0.6 and try it. Thanks.

On Tuesday, August 1, 2017 at 2:31:50 PM UTC-7, mickeyf wrote:
>
> I have tried to install and test this, but so far no joy. I'm not even 
> sure it has installed correctly. I am not up to speed on how things are 
> generally done in Python. I was not able to find an egg, but only the 
> zipped/tar'd code on git-hub. Not having clear direction on how to proceed, 
> I ran the setup.py, which did not show any complains or errors. I copied 
> the workflow_notification folder into /web/trac/plugins. My trac.ini 
> contains very nearly the example code shown on the trac hacks page:
>
> [ticket]
> ... other stuff
> workflow = ConfigurableTicketWorkflow, TicketWorkflowNotifier
>
>
>  [ticket-workflow-notifications]
> when_fixed = resolve
> when_fixed.body = Ticket ${ticket.id} has been fixed! View it here: 
> ${link}
> when_fixed.subject = Ticket ${ticket.id} is fixed!
> when_fixed.recipients = myem...@realaddress.com
> when_fixed.condition = ${ticket.resolution == 'fixed'}
>
>
> Is there a straightforward way to first test that this is actually 
> installed, and then to troubleshoot it? I have tried setting a dummy ticket 
> to 'fixed' but get neither a notification nor an error message.
>
> Thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


[Trac] Re: ticket-workflow-notifications

2017-08-10 Thread RjOllos


On Thursday, August 10, 2017 at 6:33:09 AM UTC-7, mickeyf wrote:
>
> Sorry, but where do I find version 0.6?
>


 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Re: Introduce the warehouse synchronization documents need to be updated

2017-08-10 Thread Mingxing Tian


在 2017年8月10日星期四 UTC+8下午5:50:22,RjOllos写道:
>
>
>
> On Thu, Aug 10, 2017 at 2:48 AM, Mingxing Tian  > wrote:
>
>> I try to create the file "post-receive" and enter the contents of the 
>> given, of course, modify the value of the above two lines of variables. But 
>> the result is a failure, this way is not correct. 
>>
>
> We need to know the exact steps you took and the error messages you 
> received in order to help you determine what you did incorrectly.
>
> - Ryan 
>

My steps:
 
[root@host105 svnconf]# cd /home/git/repositories/testing.git/hooks/
[root@host105 hooks]# touch post-receive
[root@host105 hooks]# vim post-receive
[root@host105 hooks]# cat post-receive
#!/bin/sh
tracenv=/home/projects/xxx # change with your Trac environment's path
repos=testing   # change with your repository's name
while read oldrev newrev refname; do
if [ "$oldrev" =  ]; then
git rev-list --reverse "$newrev" --
else
git rev-list --reverse "$newrev" "^$oldrev" --
fi | xargs trac-admin "$tracenv" changeset added "$repos"
done
[root@host105 hooks]#


-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.