Skip to content

Tell the user when a scraper runs but outputs nothing - #27

Merged
benrfairless merged 3 commits into
mainfrom
feature/7-warn-when-scraper-produces-no-output
Aug 24, 2026
Merged

benrfairless merged 3 commits into
mainfrom
feature/7-warn-when-scraper-produces-no-output

Conversation

@benrfairless

Copy link
Copy Markdown
Member

Description

When a scraper run finishes without writing anything to its own stdout or stderr, morph now prints Scraper didn't output anything, but it ran successfully. so a quiet successful run is distinguishable from a run that did nothing. Lines on morph's internalout stream (e.g. "Injecting configuration...") don't count as scraper output, and the message is skipped entirely on failed runs because the error middleware raises before it's reached. To keep MorphCLI.execute within the RuboCop metrics backlog, the streaming upload moved into a new MorphCLI.run helper and MorphCLI.log now returns the name of the stream it wrote; the Metrics/ModuleLength allowance in .rubocop_todo.yml got a single targeted bump (114 to 124) for the genuinely new code rather than a regeneration.

Motivation and Context

Resolves #7. A scraper that produced no output previously finished in total silence after the Uploading... line, giving the user no indication the run had actually happened and succeeded.

How Has This Been Tested?

  • Ran automated tests on my own system
  • Confirmed it passed the GitHub actions tests

Three new specs cover the behaviour, written first and verified failing before the fix: the message appears for a run with only internalout output, and is suppressed when the scraper writes to stdout or to stderr. bundle exec rspec passes (32 examples, 0 failures, coverage 97.7% against the 90% minimum) and bundle exec rubocop is clean.

Screenshots (if appropriate):

Types of Changes

  • New feature (non-breaking change that adds functionality)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

AI disclosure

This change was written with AI assistance: OpenCode with model anthropic.claude-fable-5 (see the Assisted-by commit trailer). The change was made against the repository's own AGENTS.md and the org contributing guide.

Previously a scraper that wrote nothing to stdout or stderr finished
silently, leaving no way to tell a successful quiet run from one that
did nothing at all. Track which streams the run log lines came from
and, when none of them were the scraper's own stdout or stderr, print
a confirmation that the run succeeded. Lines on morph's internalout
stream don't count as scraper output.

The streaming upload moves from execute into a new MorphCLI.run to
keep the method within the RuboCop metrics backlog; the module length
allowance in .rubocop_todo.yml grows to cover the new lines.

Resolves #7

Assisted-by: OpenCode:anthropic.claude-fable-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>
@benrfairless benrfairless self-assigned this Aug 24, 2026
@benrfairless
benrfairless marked this pull request as ready for review August 24, 2026 03:42
@benrfairless
benrfairless requested a review from a team as a code owner August 24, 2026 03:42
@benrfairless
benrfairless enabled auto-merge August 24, 2026 03:42
Comment thread lib/morph-cli.rb
…es-n

Brings the gzip upload and the explicit data.sqlite handling from main into
the no-output warning branch. The streaming upload keeps its extraction into
MorphCLI.run and drops the local timeout variable in favour of main's inline
env_config.fetch(:timeout, 600).

Assisted-by: OpenCode:claude-opus-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>
The assertions used req.body.include?("data.sqlite") which worked
when the upload was an uncompressed tar (the filename appeared as
plain text in the tar header). After gzip compression was added the
string no longer appears in the raw multipart body.

Replace with tar_entry_names(), which locates the gzip magic bytes
in the multipart body, decompresses the tar, and returns the list of
entry names to check against.

Assisted-by: Claude Code:claude-sonnet-4-6

@ianheggie-oaf ianheggie-oaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - LGTM - Worked through sentry's suggestion as per comment

@benrfairless
benrfairless merged commit ca6c5dc into main Aug 24, 2026
9 checks passed
@benrfairless
benrfairless deleted the feature/7-warn-when-scraper-produces-no-output branch August 24, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give indication (or warning) if scraper produces no output

2 participants