diff --git a/docs/source/development/sprint1/index.rst b/docs/source/development/sprint1/index.rst index 2ec04a2..4aefca2 100644 --- a/docs/source/development/sprint1/index.rst +++ b/docs/source/development/sprint1/index.rst @@ -34,12 +34,25 @@ Backlog .. image:: Chart1.png :width: 600 -Definition of done + +Definition of Ready ------------------ -.. todo:: +Il team ha definito lo stato di Ready di una User Story in base ai seguenti criteri: +* La User Story è stata compresa ed accettata da tutti i membri +* I tester hanno confermato la possibilità di poterla testare +* Il Product Owner ha la visione necessaria per definirne la priorità +* Il Team è in grado di stimarla +* La User Story è indipendente o dipendente da altre a priorità maggiore - Inserire qui la definition of done dello sprint. +Definition of Done +------------------ + +La definizione di Done è stata concordata da tutto il team con il Product Owner, ed è stata così definita: +* Sviluppo completo della funzionalità richiesta +* Definizione e superamento dei test +* Bozza della documentazione della funzionalità +* Merge dei sorgenti nel branch ‘Main’ di GitLab Registro attività diff --git a/docs/source/development/sprint2/index.rst b/docs/source/development/sprint2/index.rst index f1dc5dd..d04c34d 100644 --- a/docs/source/development/sprint2/index.rst +++ b/docs/source/development/sprint2/index.rst @@ -32,12 +32,26 @@ Backlog .. image:: Chart2.png :width: 600 -Definition of done + +Definition of Ready ------------------ -.. todo:: +Il team ha definito lo stato di Ready di una User Story in base ai seguenti criteri: +* La User Story è stata compresa ed accettata da tutti i membri +* I tester hanno confermato la possibilità di poterla testare +* Il Product Owner ha la visione necessaria per definirne la priorità +* Il Team è in grado di stimarla +* La User Story è indipendente o dipendente da altre a priorità maggiore + +Definition of Done +------------------ + +La definizione di Done è stata concordata da tutto il team con il Product Owner, ed è stata così definita: +* Sviluppo completo della funzionalità richiesta +* Definizione e superamento dei test +* Bozza della documentazione della funzionalità +* Merge dei sorgenti nel branch ‘Main’ di GitLab - Inserire qui la definition of done dello sprint. Registro attività diff --git a/docs/source/development/sprint3/index.rst b/docs/source/development/sprint3/index.rst index 90dafd9..ea08fbe 100644 --- a/docs/source/development/sprint3/index.rst +++ b/docs/source/development/sprint3/index.rst @@ -20,6 +20,15 @@ Tutto ciò è visibile dai task completati: .. image:: Task3.png :width: 400 +Grooming session +---------------- + +Sono state definite le nuove User Stories da inserire nel progetto sulla base delle nuove richieste pervenute dal cliente: analisi statistica più dettagliata, postare su Twitter, traduzione dell'interfaccia in inglese. +La richiesta relativa alle ricerche basate sulla geolocalizzazione, come già comunicato al cliente, non è stata inserita per motivi tecnici legati alle features delle API 1.1 che non permettono di eseguire query sui campi di posizione geografica. +Le nuove User Stories sono state valutate tramite il metodo dello Scrum Poker, durante il quale ogni membro ha espresso la sua valutazione. +Tutte le nuove richieste sono state accettate dal Product Owner e sono pronte ad essere inserite nello sprint di sviluppo in partenza. + + Backlog ------- @@ -32,12 +41,24 @@ Backlog :width: 600 -Definition of done +Definition of Ready ------------------ -.. todo:: +Il team ha definito lo stato di Ready di una User Story in base ai seguenti criteri: +* La User Story è stata compresa ed accettata da tutti i membri +* I tester hanno confermato la possibilità di poterla testare +* Il Product Owner ha la visione necessaria per definirne la priorità +* Il Team è in grado di stimarla +* La User Story è indipendente o dipendente da altre a priorità maggiore - Inserire qui la definition of done dello sprint. +Definition of Done +------------------ + +La definizione di Done è stata concordata da tutto il team con il Product Owner, ed è stata così definita: +* Sviluppo completo della funzionalità richiesta +* Definizione e superamento dei test +* Bozza della documentazione della funzionalità +* Merge dei sorgenti nel branch ‘Main’ di GitLab Registro attività @@ -112,13 +133,44 @@ Flavia Cocca - Durata - Attività * - - - + - 14h - Totale - * - - - - - + * - 20/05 + - 2.0h + - Trasferimento documenti in nuova documentazione + * - 21/05 + - 1.0h + - Studio Sphinx + + * - 23/05 + - 1.0h + - Studio sintassi rST + + * - 24/05 + - 1.0h + - Documentazione + + * - 25/05 + - 1.0h + - Documentazione + + * - 26/05 + - 1.0h + - Documentazione + + * - 27/05 + - 1.0h + - Documentazione + + * - 28/05 + - 3.0h + - Documentazione + + * - 29/05 + - 3.0h + - Documentazione Chiara Calzolari """""""""""""""" @@ -196,12 +248,45 @@ Giovanni Anniballi - Durata - Attività * - - - + - 18h - Totale - * - - - - - + * - 17/05 + - 1h + - Ricontrollo generale codice, fix piccoli typo + + * - 18/05 + - 1h + - Aggiornati files di log e refactoring documentazione + + + * - 21/05 + - 2h + - Studio Jest, valutazione di test sul frontend + + * - 24/05 + - 3h + - Primi test sulle autorizzazioni + + * - 26/05 + - 2h + - Fix ai test + + * - 27/05 + - 2h + - Test autorizzazioni completati, fix + + * - 28/05 + - 4h + - Fix test malfunzionanti, refactoring test + + * - 29/05 + - 3h + - Aggiornamento documentazione, aggiunti ulteriori test seguendo i suggerimenti di SQ + + + + Giorgio Minoccari @@ -283,9 +368,7 @@ Retrospettiva finale Schermata finale di SonarQube ----------------------------- -.. todo:: - - Inserire qui uno screenshot della schermata finale di SonarQube. +- :download:`Schermata finale Sonarqube ` Demo ---- diff --git a/docs/source/development/sprint3/sonarqube.pdf b/docs/source/development/sprint3/sonarqube.pdf new file mode 100644 index 0000000..ecda3af Binary files /dev/null and b/docs/source/development/sprint3/sonarqube.pdf differ diff --git a/nest_crawler/alert_trigger.py b/nest_crawler/alert_trigger.py index 0482fb0..036aef8 100644 --- a/nest_crawler/alert_trigger.py +++ b/nest_crawler/alert_trigger.py @@ -2,6 +2,7 @@ from datetime import datetime, timedelta from nest_backend.database import * from .authentication import authenticate import smtplib +import tweepy as tw def is_repo_alert_triggered(repository_id): @@ -36,7 +37,7 @@ def is_repo_alert_triggered(repository_id): ext.session.commit() print("alert triggered") alerts_triggered.append(alert) - send_notification_email(alert) + #send_notification_email(alert) send_notification_tweet(alert) @@ -48,14 +49,11 @@ def send_notification_email(alert): conditions_string = conditions_string[:-1] smtpObj = None try: - smtpObj = smtplib.SMTP('localhost') - smtpObj.sendmail("alert@nest.com", owner_repo.email, "Alert triggered") - print("Successfully sent email") + with smtplib.SMTP(host='localhost') as smtpObj: + smtpObj.sendmail("alert@nest.com", owner_repo.email, "Alert triggered") + print("Successfully sent email") except smtplib.SMTPException: print("Error: unable to send email") - finally: - if smtpObj is not None: - smtpObj.close() def send_notification_tweet(alert): @@ -65,7 +63,10 @@ def send_notification_tweet(alert): conditions_string += condition.condition.content + ',' conditions_string = conditions_string[:-1] print(conditions_string) - api.update_status(f"L'alert {alert.name} è stato attivato! C'è stato un incremento di popolarità negli argomenti di ricerca {conditions_string}") + try: + api.update_status(f"L'alert {alert.name} è stato attivato! C'è stato un incremento di popolarità negli argomenti di ricerca {conditions_string}") + except tw.errors.Forbidden: + print("Il tweet e' gia' stato pubblicato") __all__ = ( diff --git a/nest_crawler/repo_search.py b/nest_crawler/repo_search.py index f7d32e2..35fa7a1 100644 --- a/nest_crawler/repo_search.py +++ b/nest_crawler/repo_search.py @@ -19,6 +19,12 @@ def search_repo_conditions(repository_id): print(f"Searching tweets from repo: {repo.name}") evaluation_mode = repo.evaluation_mode + + # tweets_repo = [tweet.tweet for tweet in repo.tweets] + # tweets_repo.sort(key=lambda x: x.snowflake) + # + # latest_tweet_id = int(tweets_repo[-1].snowflake) if len(tweets_repo) > 0 else 0 + conditions_type = dict() # Dividing condition into condition types @@ -54,8 +60,8 @@ def search_repo_conditions(repository_id): for condition_content in conditions_type[ConditionType.coordinates]: coordinates_tweet = condition_content.content.split() coordinates_string = coordinates_tweet[2] + "," + coordinates_tweet[3] + "," + str(float(coordinates_tweet[1])/1000) + "km" - print(coordinates_string) - for tweet in tw.Cursor(method=api.search, q="", geocode=coordinates_string).items(10): + print(f"Le coordinate di questa condizione sono: {coordinates_string}") + for tweet in tw.Cursor(method=api.search, q="", geocode=coordinates_string).items(100): if not Tweet.query.filter_by(snowflake=str(tweet.id)).all(): image_url_list = '' if 'media' in tweet.entities.keys(): @@ -92,17 +98,17 @@ def search_repo_conditions(repository_id): queryString += ("since:" + condition_content.content[2:] + " " + queryConjunction + " ") # End of query string queryString = queryString[:-len(queryConjunction) - 1] - print(queryString) + print(f"La stringa di query finale e':{queryString}") if evaluation_mode == ConditionMode.all_or: if queryString != "": - for tweet in tw.Cursor(method=api.search, q=queryString).items(10): + for tweet in tw.Cursor(method=api.search, q=queryString).items(100): tweetsFound.append(tweet) - print(tweet.user.name + ' : ' + tweet.text + ' : ' + tweet.geo if tweet.geo is not None else '') + print(tweet.user.name + ' : ' + tweet.text + ' : ' + (tweet.geo if tweet.geo is not None else '')) elif evaluation_mode == ConditionMode.all_and: - for tweet in tw.Cursor(method=api.search, q=queryString, geocode=coordinates_string).items(10): + for tweet in tw.Cursor(method=api.search, q=queryString, geocode=coordinates_string).items(100): tweetsFound.append(tweet) - print(tweet.user.name + ' : ' + tweet.text + ' : ' + str(tweet.geo)) + print(tweet.user.name + ' : ' + tweet.text + ' : ' + (tweet.geo if tweet.geo is not None else '')) for tweet in tweetsFound: if not Tweet.query.filter_by(snowflake=str(tweet.id)).all(): image_url_list = ''