From 2d76da58d57817aded90d190efb18cb8ec4de36a Mon Sep 17 00:00:00 2001 From: Weather Date: Tue, 3 Mar 2026 23:55:28 -0500 Subject: [PATCH 1/3] Sonarqube integration --- .github/workflows/sonarqube.yml | 26 +++++++++++++++++++ src/core/google.py | 45 +++++++++++++++++++++++++++++++++ src/sonar-project.properties | 1 + 3 files changed, 72 insertions(+) create mode 100644 .github/workflows/sonarqube.yml create mode 100644 src/sonar-project.properties diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml new file mode 100644 index 0000000..3a12966 --- /dev/null +++ b/.github/workflows/sonarqube.yml @@ -0,0 +1,26 @@ +name: Sonarqube + +on: + push: + pull_request: + + +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - uses: SonarSource/sonarqube-scan-action@v6 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} \ No newline at end of file diff --git a/src/core/google.py b/src/core/google.py index 1caf494..f2903d7 100644 --- a/src/core/google.py +++ b/src/core/google.py @@ -1,3 +1,48 @@ ''' Eli Mares +''' + +''' +def calendar(): + # Call the Calendar API + now = datetime.now(timezone.utc or pytz.utc) + events_result = calendar_service.events().list( + calendarId='rti648k5hv7j3ae3a3rum8potk@group.calendar.google.com', + timeMin=now.isoformat(), + maxResults=10, + singleEvents=True, + orderBy='startTime', + ).execute() + events = events_result.get('items', []) + + final_events = "
" + + if not events: + print('No upcoming events found.') + for event in events: + start = event['start'].get('dateTime', event['start'].get('date')) + fin_date = parser.parse(start) + try: + delta = fin_date - now + except: + d = datetime.utcnow() + delta = fin_date - d + + formatted = format_timedelta(delta) if delta > timedelta(0) else "------" + + final_events += ( + """
""" + + formatted + + """
""" + ) + final_events += ( + ""+ + ''.join(event['summary'])+ + "
" + ) + final_events += "
" + + event_list = {'data': final_events} + return jsonify(event_list) + ''' \ No newline at end of file diff --git a/src/sonar-project.properties b/src/sonar-project.properties new file mode 100644 index 0000000..6ab52d1 --- /dev/null +++ b/src/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectkey=jumpstart-v2 \ No newline at end of file From d795d60772200f525b90269aef3327ff3518a96f Mon Sep 17 00:00:00 2001 From: Weather Date: Wed, 4 Mar 2026 00:00:02 -0500 Subject: [PATCH 2/3] Fixed sonarqube branch testing --- .github/workflows/sonarqube.yml | 2 ++ src/sonar-project.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 3a12966..52e4245 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -2,6 +2,8 @@ name: Sonarqube on: push: + branches: + - main pull_request: diff --git a/src/sonar-project.properties b/src/sonar-project.properties index 6ab52d1..7f80d2e 100644 --- a/src/sonar-project.properties +++ b/src/sonar-project.properties @@ -1 +1 @@ -sonar.projectkey=jumpstart-v2 \ No newline at end of file +sonar.projectKey=jumpstart-v2 From cc0375f44d2cb33d2f65017c61dfc0a788b7c701 Mon Sep 17 00:00:00 2001 From: Weather Date: Wed, 4 Mar 2026 00:06:07 -0500 Subject: [PATCH 3/3] Relocated Sonar Properties --- sonar-project.properties | 1 + src/sonar-project.properties | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 sonar-project.properties delete mode 100644 src/sonar-project.properties diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..995bea0 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=jumpstart-v2 \ No newline at end of file diff --git a/src/sonar-project.properties b/src/sonar-project.properties deleted file mode 100644 index 7f80d2e..0000000 --- a/src/sonar-project.properties +++ /dev/null @@ -1 +0,0 @@ -sonar.projectKey=jumpstart-v2