Re: [GSoC] [COMDEV-254] Allura - Personal Dashboard

2018-05-02 Thread Dave Brondsema
On 5/2/18 11:24 AM, Deshani Geethika wrote:
> Hi Dave,
> 
> Thanks for the information. I have few questions to be clarified.
> 
> I think replacing spaces with underscores would be a good way to do it,
> since on many wikis they are
> interchangable.  (They aren't for allura, but we could move towards that).
> 
> Here do you mean that spaces and underscores in a title are considered as
> same characters?
> 
> For example : "The Title" is considered same as "The_Title".

Yes that's what I was thinking.

> 
> In this situation, users should not be allowed to create 2 wikis with above
> titles, because we can't handle inbound emails for both scenarios.

Good point, I hadn't thought of that.  That does make this more complicated.
Maybe it could be a followup step to prevent creating a page that conflicts with
another one.  And then even later on we could make URLs handle spaces and
underscores interchangably.

Anyone else have ideas about what would be best?

> 
> Also, we have another problem here.
> 
> Then this handle_message method could try finding a page for that message,
> and if it
> doesn't exist, it can convert any underscores back to spaces and then try
> find
> the wiki page under that name.
> 
> Here do I need to check for all the possible number of combinations of
> underscores and spaces to find out the exact wiki page?


I was thinking if an email comes in for "Foo_Bar_Baz" first look for one titled
"Foo_Bar_Baz" and then one titled "Foo Bar Baz".  Trying every combination could
get crazy.

> 
> Regards!
> 
> 
> 
> On Wed, May 2, 2018 at 7:17 AM, Dave Brondsema  wrote:
> 
>> Cool.  That email_address property should be the main one and changing it
>> should
>> reflect in the outgoing emails that are sent to subscribers after
>> commenting or
>> editing a wiki page.
>>
>> Allura also supports *inbound* emails on most artifacts including wiki
>> pages.
>> So someone could reply to the wiki email and it would be received by
>> Allura and
>> added as a comment on the wiki page.  The
>> forgewiki.wiki_main.ForgeWikiApp#handle_message method is what is
>> responsible
>> for that.  So that code should be updated as well.  I think replacing
>> spaces
>> with underscores would be a good way to do it, since on many wikis they are
>> interchangable.  (They aren't for allura, but we could move towards
>> that).  Then
>> this handle_message method could try finding a page for that message, and
>> if it
>> doesn't exist, it can convert any underscores back to spaces and then try
>> find
>> the wiki page under that name.
>>
>> To test the inbound mails, I'm unfortunately not seeing any tests in the
>> code.
>> You could add some.  The ForgeWiki/forgewiki/tests/test_app.py file has a
>> TestBulkExport class and you could copy most of its setup, and then add a
>> test_email test case that calls wiki.handle_message.
>>
>> The other way is to use telnet or other tools like that to send the mail
>> into
>> the "inmail" docker compose container, or `paster smtp_server` service if
>> you
>> aren't using docker.  There's an example of doing that in the middle of
>> this
>> page: https://forge-allura.apache.org/p/allura/wiki/Notes/
>>
>> Hope that helps!  It sounds a little more complex of a ticket than I
>> initially
>> thought it would be.  Let us know if you have any more questions or get
>> stuck on
>> anything.
>>
>> -Dave
>>
>> On 5/1/18 12:45 PM, Deshani Geethika wrote:
>>> Hi all,
>>>
>>> During last few days, I spent time on reading the Allura documentation
>> and
>>> on getting familiarized with Allura codebase.
>>>
>>> Then, I have started to work on the ticket - #1699 Fix incoming email for
>>> wiki pages with space in the title
>>> . According to
>> my
>>> understanding, it is required to replace the spaces in the title with
>> null
>>> string (or with some character). Therefore, the getter method for
>>> email_address which is in Page.class in ForgeWiki/forgewiki/model/wiki
>> .py
>>> should be changed as below.
>>>
>>>
>>> @property
>>> def email_address(self):
>>>if context.app.config.options.get('AllowEmailPosting', True):
>>>domain = self.email_domain
>>> * self.title.replace(‘ ‘,’’) // Added line*
>>>return '%s@%s%s' % (self.title.replace('/', '.'), domain,
>>> config.common_suffix)
>>>else:
>>>return tg_config.get('forgemail.return_path')
>>>
>>> Could you tell me whether, do I need to modify any method other than the
>>> above one?
>>>
>>>
>>> Regards!
>>>
>>> On Wed, Apr 25, 2018 at 10:30 PM, Deshani Geethika <
>>> deshanigeeth...@gmail.com> wrote:
>>>
 Hi Dave,

 Thanks for the detailed explanation. I will start working on this and
>> come
 back to you with my progress

 Regards!

 On Wed, Apr 25, 2018 at 9:55 PM, Dave Brondsema 
 wrote:

> On 4/24/18 11:14 AM, Deshani Geethika wrote:

Re: [GSoC] [COMDEV-254] Allura - Personal Dashboard

2018-05-02 Thread Deshani Geethika
Hi Dave,

Thanks for the information. I have few questions to be clarified.

I think replacing spaces with underscores would be a good way to do it,
since on many wikis they are
interchangable.  (They aren't for allura, but we could move towards that).

Here do you mean that spaces and underscores in a title are considered as
same characters?

For example : "The Title" is considered same as "The_Title".

In this situation, users should not be allowed to create 2 wikis with above
titles, because we can't handle inbound emails for both scenarios.

Also, we have another problem here.

Then this handle_message method could try finding a page for that message,
and if it
doesn't exist, it can convert any underscores back to spaces and then try
find
the wiki page under that name.

Here do I need to check for all the possible number of combinations of
underscores and spaces to find out the exact wiki page?

Regards!



On Wed, May 2, 2018 at 7:17 AM, Dave Brondsema  wrote:

> Cool.  That email_address property should be the main one and changing it
> should
> reflect in the outgoing emails that are sent to subscribers after
> commenting or
> editing a wiki page.
>
> Allura also supports *inbound* emails on most artifacts including wiki
> pages.
> So someone could reply to the wiki email and it would be received by
> Allura and
> added as a comment on the wiki page.  The
> forgewiki.wiki_main.ForgeWikiApp#handle_message method is what is
> responsible
> for that.  So that code should be updated as well.  I think replacing
> spaces
> with underscores would be a good way to do it, since on many wikis they are
> interchangable.  (They aren't for allura, but we could move towards
> that).  Then
> this handle_message method could try finding a page for that message, and
> if it
> doesn't exist, it can convert any underscores back to spaces and then try
> find
> the wiki page under that name.
>
> To test the inbound mails, I'm unfortunately not seeing any tests in the
> code.
> You could add some.  The ForgeWiki/forgewiki/tests/test_app.py file has a
> TestBulkExport class and you could copy most of its setup, and then add a
> test_email test case that calls wiki.handle_message.
>
> The other way is to use telnet or other tools like that to send the mail
> into
> the "inmail" docker compose container, or `paster smtp_server` service if
> you
> aren't using docker.  There's an example of doing that in the middle of
> this
> page: https://forge-allura.apache.org/p/allura/wiki/Notes/
>
> Hope that helps!  It sounds a little more complex of a ticket than I
> initially
> thought it would be.  Let us know if you have any more questions or get
> stuck on
> anything.
>
> -Dave
>
> On 5/1/18 12:45 PM, Deshani Geethika wrote:
> > Hi all,
> >
> > During last few days, I spent time on reading the Allura documentation
> and
> > on getting familiarized with Allura codebase.
> >
> > Then, I have started to work on the ticket - #1699 Fix incoming email for
> > wiki pages with space in the title
> > . According to
> my
> > understanding, it is required to replace the spaces in the title with
> null
> > string (or with some character). Therefore, the getter method for
> > email_address which is in Page.class in ForgeWiki/forgewiki/model/wiki
> .py
> > should be changed as below.
> >
> >
> > @property
> > def email_address(self):
> >if context.app.config.options.get('AllowEmailPosting', True):
> >domain = self.email_domain
> > * self.title.replace(‘ ‘,’’) // Added line*
> >return '%s@%s%s' % (self.title.replace('/', '.'), domain,
> > config.common_suffix)
> >else:
> >return tg_config.get('forgemail.return_path')
> >
> > Could you tell me whether, do I need to modify any method other than the
> > above one?
> >
> >
> > Regards!
> >
> > On Wed, Apr 25, 2018 at 10:30 PM, Deshani Geethika <
> > deshanigeeth...@gmail.com> wrote:
> >
> >> Hi Dave,
> >>
> >> Thanks for the detailed explanation. I will start working on this and
> come
> >> back to you with my progress
> >>
> >> Regards!
> >>
> >> On Wed, Apr 25, 2018 at 9:55 PM, Dave Brondsema 
> >> wrote:
> >>
> >>> On 4/24/18 11:14 AM, Deshani Geethika wrote:
>  Hi Dave,
> 
>  As per GSoC official time-line, from 23rd April to 14th May period is
>  considered as "Community Bonding Period".
> 
>  During this period I would like to finalize my design and separate my
>  project into several tickets. Also, I would like to get more
> >>> familiarized
>  with Allura code-base and Allura team.
> 
>  Could you guide me what would be the best way to start off with.
> 
>  Regards!
> 
> >>>
> >>> Sounds like good goals for the community bonding period.
> >>>
> >>> I've added you as a developer on our self-hosted Allura project
> >>> https://forge-allura.apache.org/p/allura/ which means you can