-
Notifications
You must be signed in to change notification settings - Fork 11
Sync with upstream #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* New App: German Party Polls * Fixed app name * Fixed app summary * Update app description in manifest.yaml to include a period at the end. * Fixed linting * Fixed: Bundestagswahl Table Fix
* An that reports the status of the route on the CTA 'L' in Chicago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @IngmarStein, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request synchronizes with the upstream repository, incorporating several updates and modifications across different applets. It introduces a new applet for displaying ATB bus times in Trondheim, Norway, and updates the CTA 'L' Status applet with new configuration options and improved data handling. Additionally, it updates the FAA ATIS applet for displaying airport runway information and the German party polls applet for displaying election polls. There are also minor updates to the Pinball Map and Planes Overhead applets, and SANFL applets.
Highlights
- New App: ATB Bus Times: Introduces a new applet to display real-time bus departures from ATB stops in Trondheim, Norway, using the Entur API.
- CTA 'L' Status Updates: Adds new configuration options to the CTA 'L' Status applet, including alert display preferences, scroll speed, and filtering options for active, accessibility, planned, and recent alerts. Also improves data handling and rendering.
- FAA ATIS Applet Updates: Updates the FAA ATIS applet to improve runway extraction and display, including fetching runway data from an airport database and enhancing the parsing logic for ATIS information.
- Planes Overhead Applet Updates: Refactors the Planes Overhead applet to remove the dependency on secret API keys and updates the method for retrieving aircraft type codes.
- SANFL Applet Updates: Updates the SANFL applets to use a new API URL, reduce cache times during weekends, and add a leading zero to the game clock when seconds are less than 10.
Changelog
Click here to see the changelog
- apps/atb-bus-times/atb_bus_times.star
- Introduces a new applet to display real-time bus departures from ATB stops in Trondheim, Norway.
- Fetches data from the Entur API and renders it in a user-friendly format.
- apps/atb-bus-times/manifest.yaml
- Adds a manifest file for the new ATB Bus Times applet, defining its metadata and configuration.
- apps/ctaLStatus/README.md
- Updates the README file to reflect the new configuration options available for the CTA 'L' Status applet.
- apps/ctaLStatus/ctaLStatus.star
- Adds new configuration options for alert display, scroll speed, and filtering alerts by active status, accessibility, planned status, and recency.
- Improves data handling and rendering of CTA 'L' status and alerts.
- apps/ctaLStatus/manifest.yaml
- Updates the manifest file for the CTA 'L' Status applet.
- apps/faaatis/faa_atis.star
- Improves runway extraction and display logic.
- Fetches runway data from an airport database to validate runway designators.
- Enhances parsing logic for ATIS information to accurately identify active runways.
- apps/faaatis/manifest.yaml
- Updates the manifest file for the FAA ATIS applet.
- apps/germanpartypolls/germanpartypolls.star
- Updates the German party polls applet to display election polls.
- apps/germanpartypolls/manifest.yaml
- Updates the manifest file for the German party polls applet.
- apps/pinballmap/pinball_map.star
- Increases the cache time from 30 seconds to 600 seconds (10 minutes) to reduce API calls.
- apps/planesoverhead/planes_overhead.star
- Removes the dependency on secret API keys.
- Updates the method for retrieving aircraft type codes using a new API endpoint.
- Removes the 'dev_api_key' configuration option.
- apps/sanflladder/sanfl_ladder.star
- Updates the SANFL applets to use a new API URL.
- Reduces cache times during weekends to ensure more frequent updates.
- apps/sanflscores/sanfl_scores.star
- Updates the SANFL applets to use a new API URL.
- Reduces cache times during weekends to ensure more frequent updates.
- Adds a leading zero to the game clock when seconds are less than 10.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A pixel bright,
Data streams in the night,
Info takes its form.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request includes several updates and new app integrations. The changes generally look good, but there are a few areas where improvements can be made to enhance code clarity and efficiency. Specifically, I've focused on cache management, API key handling, and code readability.
Summary of Findings
- Cache Time Consistency: In
pinball_map.star
, the cache time is increased from 30 seconds to 600 seconds. While this reduces API calls, ensure this longer cache time doesn't negatively impact the app's responsiveness to real-time changes. Consider making this configurable. - API Key Security: The
planesoverhead
app removes the use ofsecret.star
for the API key. While this simplifies the code, it's crucial to ensure that API keys are handled securely, especially in production environments. Evaluate the implications of this change on API usage limits and potential abuse. - Weekend Cache Reduction Logic: In
sanflscores.star
andsanfl_ladder.star
, the cache time is reduced on weekends. This is a good optimization for frequently updated data. However, ensure that the logic for determining the weekend and applying the cache reduction is robust and accounts for different timezones or edge cases.
Merge Readiness
The pull request introduces valuable updates and new apps. However, before merging, it's important to address the identified issues, particularly those related to cache management and API key handling. Addressing these points will improve the reliability, security, and maintainability of the codebase. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging, especially after the requested changes have been made.
@@ -8,7 +8,7 @@ load("http.star", "http") | |||
load("render.star", "render") | |||
load("schema.star", "schema") | |||
|
|||
CACHE_TIME_IN_SECONDS = 30 | |||
CACHE_TIME_IN_SECONDS = 600 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FROM aircraft | ||
WHERE icao24 = '%s' | ||
""" % (icao24) | ||
def get_typecode(icao24): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding some error handling or a default value if the typecode
is not found. This will prevent the app from crashing or displaying incorrect information if the API call fails or returns an unexpected response. What do you think?
data = json.decode(response) if len(response) > 0 else {}
return data.get("typecode", "Unknown")
|
||
typecode = json.decode(post_response)[0][0]["Value"] if len(post_response) > 0 else "" | ||
# Parse JSON safely | ||
data = json.decode(response) if len(response) > 0 else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a check to ensure that the response
is valid JSON before attempting to decode it. This will prevent the app from crashing if the API returns an invalid response. What do you think?
try:
data = json.decode(response) if len(response) > 0 else {}
except Exception as e:
print("Error decoding JSON: {}".format(e))
data = {}
No description provided.