Skip to content

Conversation

@chriskyfung
Copy link
Owner

@chriskyfung chriskyfung commented Jan 17, 2026

  • Introduce add_article_preview parameter to get_articles, get_all_articles, and _parse_article_data methods to optionally extract and include article preview text.
  • Update save_to_sqlite function to handle the new preview field in database schema and inserts, improving data completeness for users.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

- Introduce `add_article_preview` parameter to `get_articles`, `get_all_articles`, and `_parse_article_data` methods to optionally extract and include article preview text.
- Update `save_to_sqlite` function to handle the new preview field in database schema and inserts, improving data completeness for users.
@gemini-code-assist
Copy link

Summary of Changes

Hello @chriskyfung, 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!

This pull request significantly enhances the Instapaper scraper by providing an optional mechanism to extract and persist article preview text. This addition allows users to gather more comprehensive data for each article, improving the utility of the scraped information without altering the default behavior for existing users.

Highlights

  • Feature: Article Previews: Introduced an add_article_preview parameter to the core scraping functions (get_articles, get_all_articles, _parse_article_data) to optionally extract and include article preview text from Instapaper.
  • CLI Integration: Added a new command-line argument --add-article-preview to allow users to enable the article preview scraping directly from the CLI.
  • Data Storage Enhancement: Updated the save_to_sqlite, save_to_csv, and save_to_json functions to handle and store the new article_preview field, ensuring data completeness across all output formats.
  • Comprehensive Testing: New and updated tests were added to cover the article preview functionality, including scenarios where previews are present, missing, or not requested, ensuring robustness.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

Footnotes

  1. 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.

@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 92.70833% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/instapaper_scraper/output.py 50.00% 4 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@chriskyfung chriskyfung self-assigned this Jan 17, 2026
@chriskyfung chriskyfung added documentation Improvements or additions to documentation enhancement New feature or request python Pull requests that update python code labels Jan 17, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 effectively adds support for scraping and storing article previews. The changes are well-structured, touching the API, CLI, and output modules, and include corresponding updates to the tests. The new feature is also well-documented in docstrings and CLI help messages. I've found a couple of minor opportunities for improvement regarding code consistency and clarity, which I've detailed in the comments below.

@chriskyfung chriskyfung added this to the Feature Expansion milestone Jan 17, 2026
This commit updates the documentation files to reflect the new  feature.

- Updates GEMINI.md to mention the new CLI option and output field.
- Updates README.md to include the new command-line argument and updated output examples.
- Use KEY_ARTICLE_PREVIEW constant in api.py for better maintainability
- Remove add_article_preview parameter from save_to_json, always including previews
- Ensures article previews are consistently handled in scraped data output
Introduces new tests to `tests/test_output.py` to enhance robustness and cover edge cases in the output functionalities.

This includes tests for:
- Saving to SQLite with `instapaper_url` to verify content.
- Saving to JSON with `instapaper_url` to ensure correct data transformation and non-mutation of original data.
- Verifying the creation of necessary output directories by `save_articles`.
- Handling `IOError` during article saving operations.
- Gracefully managing articles with missing 'id' when `instapaper_url` is requested.
- Detecting and handling malformed article data (non-dictionary items).
- Changed assertions in test_get_sqlite_create_table_sql_with_url_old_sqlite and test_get_sqlite_insert_sql_without_manual_url to compare against full expected SQL strings instead of partial substring checks, ensuring stricter validation.
- Added a blank line after test_save_articles_corrects_extension for better readability.
This adjustment relaxes the code coverage requirement, allowing for more flexibility in patch-level coverage while maintaining a 2% threshold. This can help reduce CI failures for minor uncovered lines in pull requests.
@chriskyfung chriskyfung merged commit 1da7ae3 into master Jan 18, 2026
18 checks passed
@chriskyfung chriskyfung deleted the feat/add-article-preview-column branch January 18, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant