fetch_util 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -0
- data/README.md +3 -1
- data/Rakefile +0 -2
- data/lib/fetch_util/assets/extract.js +1 -1
- data/lib/fetch_util/browser/interaction_helpers/consent_helpers.rb +12 -17
- data/lib/fetch_util/browser/interaction_helpers/timing_helpers.rb +42 -15
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_commit_details_script.rb +48 -0
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_product_state_script.rb +80 -0
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_request_helpers_script.rb +53 -0
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_request_state_script.rb +118 -0
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_stabilization.rb +54 -0
- data/lib/fetch_util/browser/site_stabilization/azure_devops_pr_state.rb +27 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_diff_product_state.rb +55 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_diff_request_state.rb +100 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_diff_state.rb +59 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_resource_modules.rb +26 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_resource_state.rb +93 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_pull_resources.rb +73 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_thread_state.rb +92 -0
- data/lib/fetch_util/browser/site_stabilization/bitbucket_cloud_threads.rb +71 -0
- data/lib/fetch_util/browser/site_stabilization/community_and_marketplace.rb +9 -10
- data/lib/fetch_util/browser/site_stabilization/facebook_stabilization.rb +56 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_change_product_state_script.rb +97 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_change_request_state_script.rb +75 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_change_stabilization.rb +37 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_change_state.rb +39 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_fetch_state_script.rb +31 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_product_state_script.rb +76 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_request_state_script.rb +111 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_route_state_script.rb +71 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_stabilization.rb +37 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_state.rb +42 -0
- data/lib/fetch_util/browser/site_stabilization/gerrit_file_resource_validation_state_script.rb +49 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_pull_resource_product_state.rb +88 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_pull_resource_state.rb +109 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_pull_resources.rb +30 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_stabilization.rb +60 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_thread_product_state.rb +74 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_thread_timeline_state.rb +69 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_threads.rb +28 -0
- data/lib/fetch_util/browser/site_stabilization/gitea_family_visibility_script.rb +28 -0
- data/lib/fetch_util/browser/site_stabilization/github_pull_resource_stabilization.rb +31 -0
- data/lib/fetch_util/browser/site_stabilization/github_pull_resources.rb +105 -0
- data/lib/fetch_util/browser/site_stabilization/github_threads.rb +82 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_merge_request_resource_state.rb +17 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_merge_request_resource_state_script.rb +98 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_merge_request_resource_visibility_script.rb +43 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_merge_request_resources.rb +28 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_repo.rb +3 -11
- data/lib/fetch_util/browser/site_stabilization/gitlab_stabilization.rb +33 -0
- data/lib/fetch_util/browser/site_stabilization/gitlab_threads.rb +92 -0
- data/lib/fetch_util/browser/site_stabilization/social_platforms.rb +19 -38
- data/lib/fetch_util/browser/site_stabilization/travel_and_lodging.rb +3 -3
- data/lib/fetch_util/browser/site_stabilization.rb +89 -0
- data/lib/fetch_util/browser/stabilization/anubis.rb +4 -5
- data/lib/fetch_util/browser/stabilization/page_flow.rb +71 -27
- data/lib/fetch_util/browser/stabilization/spa_hydration.rb +7 -5
- data/lib/fetch_util/browser.rb +88 -17
- data/lib/fetch_util/cli.rb +69 -23
- data/lib/fetch_util/extractor.rb +8 -2
- data/lib/fetch_util/fetcher.rb +144 -43
- data/lib/fetch_util/http_redirect_client.rb +161 -0
- data/lib/fetch_util/parallel_fetcher.rb +125 -28
- data/lib/fetch_util/raw_docs_fallback.rb +158 -21
- data/lib/fetch_util/regulatory/cache_store.rb +47 -14
- data/lib/fetch_util/regulatory/fetch_records.rb +10 -7
- data/lib/fetch_util/regulatory/headers.rb +8 -1
- data/lib/fetch_util/regulatory/http_client.rb +2 -97
- data/lib/fetch_util/regulatory/orchestration.rb +10 -6
- data/lib/fetch_util/regulatory/page.rb +8 -11
- data/lib/fetch_util/regulatory/robots.rb +2 -10
- data/lib/fetch_util/regulatory/source_selection.rb +13 -3
- data/lib/fetch_util/regulatory/tdm_page.rb +9 -4
- data/lib/fetch_util/regulatory/tdm_policy.rb +16 -9
- data/lib/fetch_util/regulatory/tdm_rep.rb +4 -3
- data/lib/fetch_util/regulatory/tdm_support.rb +10 -6
- data/lib/fetch_util/regulatory.rb +5 -1
- data/lib/fetch_util/request_log.rb +24 -3
- data/lib/fetch_util/result.rb +37 -89
- data/lib/fetch_util/search_transport.rb +102 -35
- data/lib/fetch_util/searcher.rb +15 -13
- data/lib/fetch_util/version.rb +1 -1
- data/lib/fetch_util.rb +4 -1
- metadata +66 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 022d84d7957fe472fb629b924f94186dfac9b9580f82c5328ff12cf3b5ca6a46
|
|
4
|
+
data.tar.gz: 8763a069528603a7eec56627a307a912de04e5496fc474a3595896e891219e55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d683c14eb03d374c4d62eb52bd84f27e0dd118f0474c50899670554d9a33a7bd4fd8497c5784ab5748cf107fc1d7da968e68687fabb18b22a0cd57d94ba1f3b
|
|
7
|
+
data.tar.gz: b3af03045cdad03da66eda66229395d3a93ab6494b867eeee5e66a68c892d3c58928d75b66d2a6c01499f007b1875ae50023190395a7a68429fc054fade709d1
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,55 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.6.0 - 2026-09-08
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Expand issue, pull-request, merge-request and code-review conversation extraction across GitHub, GitLab, Gitea/Forgejo, Bitbucket Cloud, Pagure, Gerrit and Azure DevOps, preserving materialized comments, replies, timeline activity and record-local attribution.
|
|
10
|
+
- Add forge resource inventories for supported commit, changed-file, diff, check, pipeline and report pages, including selected Gerrit patch sets, Azure DevOps commit details, and Bitbucket pull activity and statuses.
|
|
11
|
+
- Add SourceHut todo-ticket conversations, mailing-list threads, patchset reviews and Git commit diffs, including one-sided changes.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Preserve independently owned direct, wrapped, named and image-backed cards, including product tiles, figure collections, short CJK titles, series/episode headings, prices and local descriptive fields. Avoid borrowing page-wide prose or promoting bylines and nested references into separate records.
|
|
16
|
+
- Retain named and plain grouped-link labels, including short labels and distinct destination aliases, without assigning sibling labels as descriptions or mistaking qualified groups for navigation.
|
|
17
|
+
- Combine structured cards, plain links and headline records in DOM order without stopping discovery after an initial set of candidates. Preserve recurring records, table rowspans, section headings and surrounding prose while avoiding duplicate representations of the same physical record.
|
|
18
|
+
- Improve article/list arbitration and same-root or nested-root coverage so partial sections do not replace fuller material. Preserve mixed product-homepage narrative and enrich proven main articles only after root arbitration, retaining the selected article's metadata.
|
|
19
|
+
- Recover material from controlled panels, dormant document roots and stale or deferred visibility when ownership is established, while excluding hidden navigation, unrelated variants and unsupported access states.
|
|
20
|
+
- Improve portal, event, press-release, product, job, lodging and podcast extraction, including restored records, local fields and recurring entries. Keep record-owned metadata and descriptive accessibility labels separate from page chrome.
|
|
21
|
+
- Resolve page-owned structured data across scripts and same-document identifiers, merge array and scalar values, reject foreign owners, and keep publication and modification times distinct.
|
|
22
|
+
- Preserve nested Markdown structure, embedded code fences and fragment-targeted documentation sections, including empty ID anchors and literal plus signs. Leave unknown optional language and document metadata unset instead of inventing values.
|
|
23
|
+
- Reduce false consent, newsletter, redirect, homepage and content-completeness warnings by using owned evidence rather than unrelated footer links, card dates or inflated URL text. Classify access warnings after the final content has been selected.
|
|
24
|
+
- Stabilize redirected and dynamically hydrated pages within bounded browser lifecycles. Preserve successful results and primary exceptions across page, browser, extractor-timeout and connection cleanup failures, including failed startup and shutdown paths.
|
|
25
|
+
- Preserve ordered partial results and blank input positions in parallel fetches, join workers after startup failures, and reject unsafe shared-browser worker configurations. Validate concurrency and finite timeout/wait budgets.
|
|
26
|
+
- Snapshot caller-owned URLs, headers, paths, browser options and source configuration before deferred or concurrent work; retain immutable result warnings and metadata without freezing caller-owned strings.
|
|
27
|
+
- Normalize IRIs before transport, preserve meaningful redirect query identity and private-suffix tenant boundaries, and require appropriate evidence for DOI redirects and PDF detection. Bound PDF redirect probes and fall back after failed or TLS-error probes.
|
|
28
|
+
- Enforce total HTTP deadlines and response-body limits before buffering, isolate concurrent connection pools, and preserve fractional timeout budgets. Apply search byte limits during decompression, retain monotonic deadlines, report DNS failures and avoid treating organic result text as response-shell boilerplate.
|
|
29
|
+
- Make regulatory cache writes atomic and cache failures nonfatal; avoid caching transient failures and ignore invalid or future-dated entries. Improve active crawler-meta parsing, expanded ODRL terms, origin-scoped policy targets and bounded transient HTTP retries.
|
|
30
|
+
- Honor command-local CLI help and return nonzero status with concise messages for expected input and option errors instead of misleading success or Ruby backtraces.
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
|
|
34
|
+
- Reject unsupported URL schemes and credential-bearing public fetch URLs, canonical URLs and extracted destinations; restrict materialized public links to HTTP(S).
|
|
35
|
+
- Reject HTTPS-to-HTTP downgrades in search redirects and validate redirect targets before transport.
|
|
36
|
+
- Redact credentials from request logs, escape record delimiters and normalize log filenames without replacing a primary fetch exception with a logging failure.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Make one-shot `FetchUtil.fetch` close its browser session; reusable `Fetcher` instances retain explicit lifecycle control.
|
|
41
|
+
- Declare `public_suffix` as a runtime dependency for tenant-aware URL comparisons and load Ferrum when loading the public library classes.
|
|
42
|
+
- Pin the contributor-only Terser toolchain through `package-lock.json`; use `npm ci` before building. Asset verification now checks the installed toolchain, complete ordered manifest, duplicate entries and duplicate top-level callable ownership.
|
|
43
|
+
- Fail gem packaging when the required runtime bundle is missing or stale. Exclude dependency trees, nested lockfiles, build-time JavaScript sources and hidden fallback files, including packaging outside a Git checkout.
|
|
44
|
+
|
|
45
|
+
### Performance
|
|
46
|
+
|
|
47
|
+
- Reuse group, card-text and figure-ownership proofs within a single immutable extraction pass, including negative results, while invalidating them for subsequent DOM states. This avoids repeated scans without increasing timeouts or capping material output.
|
|
48
|
+
- Avoid redundant browser idle waits, share forge stabilization loops and index search-source responses once.
|
|
49
|
+
|
|
50
|
+
### Known Limitations
|
|
51
|
+
|
|
52
|
+
- Some sites still regress relative to v0.5.2, particularly in card-local metadata and description ownership. The multi-site regression comparison does not establish lossless extraction or uniform improvement across all sites.
|
|
53
|
+
|
|
5
54
|
## v0.5.2 - 2026-07-21
|
|
6
55
|
|
|
7
56
|
### Fixed
|
data/README.md
CHANGED
|
@@ -204,6 +204,7 @@ Browser-profile normalization is intentionally limited to reducing obvious runti
|
|
|
204
204
|
Run from `/srv/code/rbutils/fetch_util`:
|
|
205
205
|
|
|
206
206
|
```sh
|
|
207
|
+
npm ci
|
|
207
208
|
bundle exec rake build_extract_assets
|
|
208
209
|
bundle exec rake verify_extract_assets
|
|
209
210
|
bundle exec rspec
|
|
@@ -213,7 +214,8 @@ bundle exec rake
|
|
|
213
214
|
|
|
214
215
|
- The shipped browser bundle is `lib/fetch_util/assets/extract.js`.
|
|
215
216
|
- Source JS lives under `websieve/` and is ordered by `websieve/manifest.txt`.
|
|
216
|
-
- `
|
|
217
|
+
- `npm ci` installs the exact contributor-only Terser version from `package-lock.json`.
|
|
218
|
+
- `bundle exec rake build_extract_assets` rebuilds the bundle with local `npx --no-install terser -cm` before writing `extract.js`.
|
|
217
219
|
- `bundle exec rake verify_extract_assets` checks that the built bundle matches the current sources.
|
|
218
220
|
- The default `bundle exec rake` task runs asset verification, specs, and RuboCop.
|
|
219
221
|
- Direct `bundle exec rspec` runs still check bundle freshness through `spec/build_extract_assets_spec.rb` and enforce the repo-wide SimpleCov minimum.
|
data/Rakefile
CHANGED
|
@@ -15,9 +15,7 @@ task :verify_extract_assets do
|
|
|
15
15
|
ruby "script/build_extract_assets.rb", "--check"
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
task verify_extract_assets: :build_extract_assets
|
|
19
18
|
task spec: :build_extract_assets
|
|
20
19
|
task build: :build_extract_assets
|
|
21
|
-
task release: :build_extract_assets
|
|
22
20
|
|
|
23
21
|
task default: %i[verify_extract_assets spec rubocop]
|