<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks a lot! This cleared all my doubts. I will try to send a working prototype as soon as possible.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Rajdeep</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 18, 2019 at 9:04 PM Mojca Miklavec <<a href="mailto:mojca@macports.org">mojca@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear Rajdeep,<br>
<br>
On Mon, 18 Mar 2019 at 13:30, Rajdeep Bharati wrote:<br>
><br>
> Should this Django app automatically display new ports whenever a new one is created?<br>
<br>
Yes.<br>
<br>
Your question could be understood in two different ways:<br>
(1) Should the app display a "What's new" page listing the ports that<br>
have been added in the last X days?<br>
(2) Should the app know about ports that have recently been added.<br>
<br>
The answer to the second question is a definite yes. There should be<br>
some job running on some server that inspects new git commits and<br>
updates the information whenever new commits come in. This could<br>
perhaps be part of the buildbot job which builds portindex on regular<br>
basis.<br>
<br>
The answer to the first one is: yes, it would be nice. Not absolutely<br>
necessary and not the highest priority, but the database should be<br>
structured in a way that would allow making queries like that one.<br>
<br>
> I guess there is no such API that gives the current ports ATM;<br>
<br>
Not yet. It should become available with the new Django app though :)<br>
<br>
The only thing we have at the moment is a Postgres database which powers<br>
    <a href="https://www.macports.org/ports.php" rel="noreferrer" target="_blank">https://www.macports.org/ports.php</a><br>
but that part should be gone once the new app becomes available. The<br>
script to generate that list is in<br>
    macports-infrastructure/jobs/portindex2postgres.tcl<br>
and is being run as part of<br>
    <a href="https://build.macports.org/builders/jobs-portindex" rel="noreferrer" target="_blank">https://build.macports.org/builders/jobs-portindex</a><br>
<br>
> and in that case, would I also have to work on the core MacPorts repositories?<br>
<br>
I'm not 100 % sure what you mean with this question, but the student<br>
working on the web app should generally not be required to make any<br>
(significant) changes to the core of the package manager. It might be<br>
helpful to have at least a bit of insight into the code to be able to<br>
fix some trivial issues every now and then (like it turned out that<br>
portindex2json needs some minor tweaks), but any bugs, complex issues<br>
(or even trivial ones if needed) in MacPorts itself can be fixed by<br>
the core team. The Tcl core code needs some time to get used to it,<br>
and getting a deeper understanding would be required for students who<br>
select a project related to the core, while Django app requires<br>
confidence is Python, database design, some (python and/or shell)<br>
scripting. Understanding and being able to fix Tcl code is just a<br>
bonus that lets you do some stuff quickly alone, but not a<br>
requirement.<br>
<br>
Yes, the code should probably end up in various parts of different<br>
MacPorts repositories at times to make the integration of the app with<br>
the existing jobs & tools possible. But in most cases that would<br>
probably be some python or shell scripts, depending on the approach.<br>
It would probably be essential to eventually understand how the<br>
buildbot setup works, so that it can be modified, but we can also help<br>
with that.<br>
<br>
Probably more than 90 % of the code would end up in its own repository.<br>
<br>
Mojca<br>
</blockquote></div>