Skip to content

feat(martin-cp): indicativ based progress bar#2495

Merged
CommanderStorm merged 35 commits intomaplibre:mainfrom
CommanderStorm:indicativ
Feb 28, 2026
Merged

feat(martin-cp): indicativ based progress bar#2495
CommanderStorm merged 35 commits intomaplibre:mainfrom
CommanderStorm:indicativ

Conversation

@CommanderStorm
Copy link
Member

@CommanderStorm CommanderStorm commented Jan 10, 2026

This PR migrates us from our own progress bar to indicativ.

Needs tracing done first

This produces the following output:

00:00:02 -> eta: 10w [░                                        0%] 611973/1,466,015,503,701 (249,001.8169/s) | ✓ 5 □ 509994 

and when done

0:00:01 -> eta: 0s [████████████████████████████████████████ 100%] 5/5 (137.9386/s) | ✓ 5 □ 0

I was resonably uncreative with the template, might be a better option, not sure -> https://docs.rs/indicatif/latest/indicatif/#templates

Also note that this is not the be-all/end-all of solutions, this for example has the following problems:
It does not use all of indicatif/indicatif-tracins' functionality -> for example we could use a trace or a multiprocess-style, ...
=> iterative development

@CommanderStorm CommanderStorm changed the title feat: indicativ based progress bar feat(martin-cp): indicativ based progress bar Jan 14, 2026
@CommanderStorm CommanderStorm marked this pull request as ready for review January 14, 2026 07:05
Copilot AI review requested due to automatic review settings January 14, 2026 07:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the martin-cp tool from a custom progress bar implementation to the indicatif library. The changes integrate tracing-indicatif for progress bar support while maintaining tracing compatibility.

Changes:

  • Adds indicatif and tracing-indicatif dependencies to enable standardized progress bar functionality
  • Introduces init_with_progress method in logging.rs to initialize tracing with indicatif integration
  • Refactors the Progress struct in martin-cp.rs to use indicatif's ProgressBar instead of custom Display implementation
  • Extracts log bridge initialization into a separate init_log_bridge function

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Cargo.toml Adds workspace dependencies for indicatif 0.18.3 and tracing-indicatif 0.3
Cargo.lock Updates dependency lock with new indicatif-related packages and transitive dependencies
martin/Cargo.toml References the new workspace dependencies for the martin crate
martin/src/logging.rs Adds init_with_progress method and refactors init_tracing to support optional progress bar; extracts log bridge initialization
martin/src/bin/martin-cp.rs Refactors Progress struct to use indicatif ProgressBar; removes custom duration formatting and Display implementation

@nyurik
Copy link
Member

nyurik commented Jan 16, 2026

what is the output in case there is no terminal? e.g. running in CI

@CommanderStorm CommanderStorm marked this pull request as draft January 16, 2026 08:34
@CommanderStorm
Copy link
Member Author

what is the output in case there is no terminal? e.g. running in CI

This currently just prints nothing at all.
Not exactly sure where this requires work upstream or if this is possible without major achitecutral changes.

@nyurik
Copy link
Member

nyurik commented Jan 16, 2026

heh, i guess i did look into it a while back :) So we could try to implement it upstream, or at least have a local workaround. Proposal: if not terminal, print what we print now, using TIME is the only indicator when to print. E.g. print every five minutes. Alternatively we could print on a log scale, e.g. on this schedule:

  • 5 second
  • 10 second
  • 30 second
  • 1 minute
  • 2 minute
  • 5 minute
  • every 5 minute until 1 hr
  • every 30 min ever after

@socket-security
Copy link

socket-security bot commented Jan 27, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​indicatif@​0.18.310010093100100

View full report

@CommanderStorm CommanderStorm marked this pull request as ready for review February 27, 2026 22:46
@CommanderStorm
Copy link
Member Author

I think all issues are resolved 👍🏻

Copy link
Member

@nyurik nyurik left a comment

Choose a reason for hiding this comment

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

thanks!!

@CommanderStorm CommanderStorm merged commit 8dfc1e8 into maplibre:main Feb 28, 2026
40 checks passed
@CommanderStorm CommanderStorm mentioned this pull request Feb 27, 2026
CommanderStorm added a commit that referenced this pull request Mar 15, 2026
## 🤖 New release

* `martin-tile-utils`: 0.6.10 -> 0.6.11 (✓ API compatible changes)
* `mbtiles`: 0.15.2 -> 0.15.3 (✓ API compatible changes)
* `martin-core`: 0.3.0 -> 0.3.1 (✓ API compatible changes)
* `martin`: 1.3.1 -> 1.4.0

<details><summary><i><b>Changelog</b></i></summary><p>


## `mbtiles`

<blockquote>

##
[0.15.3](mbtiles-v0.15.2...mbtiles-v0.15.3)
- 2026-03-14

### Added

- *(srv)* resolve some compression TODOS
([#2597](#2597))

### Fixed

- Accept any INT-containing type in MBTiles validation to be an integer
([#2560](#2560))

### Other

- rename the `webp.sql` fixture to `webp-no-primary.sql`
([#2564](#2564))
- More restrictive expects
([#2562](#2562))
</blockquote>

## `martin-core`

<blockquote>

##
[0.3.1](martin-core-v0.3.0...martin-core-v0.3.1)
- 2026-03-14

### Added

- Add retry mechanism on locked/busy mbtiles files
([#2572](#2572))

### Other

- More restrictive expects
([#2562](#2562))
- feature-gate PostgreSQL tests to remove external dependencies from
`cargo test` ([#2558](#2558))
</blockquote>

## `martin`

<blockquote>

##
[1.4.0](martin-v1.3.1...martin-v1.4.0)
- 2026-03-14

### Added

- *(srv)* resolve some compression TODOS
([#2597](#2597))
- Migrate mdbooks to zensical
([#2576](#2576))
- *(martin-cp)* indicativ based progress bar
([#2495](#2495))
- Add retry mechanism on locked/busy mbtiles files
([#2572](#2572))

### Fixed

- *(ui)* render MLT tiles correctly in Tile Inspector
([#2601](#2601))
- redirect ignoring `--route-prefix` for .pbf tile requests
([#2599](#2599))
- restrict zooming and panning on data inspector
([#2574](#2574))
- Accept any INT-containing type in MBTiles validation to be an integer
([#2560](#2560))

### Other

- *(deps)* Bump the all-npm-version-updates group across 2 directories
with 9 updates ([#2608](#2608))
- *(deps-dev)* Bump undici from 7.21.0 to 7.24.1 in /martin/martin-ui in
the all-npm-security-updates group across 1 directory
([#2602](#2602))
- *(deps)* autoupdate pre-commit
([#2592](#2592))
- *(deps)* Bump the all-npm-version-updates group across 2 directories
with 13 updates ([#2577](#2577))
- *(deps)* Bump the all-npm-security-updates group across 2 directories
with 1 update ([#2575](#2575))
- *(deps)* autoupdate pre-commit
([#2567](#2567))
- rename the `webp.sql` fixture to `webp-no-primary.sql`
([#2564](#2564))
- more cfg magic instead of #[allow(unused_variables)]
([#2563](#2563))
- More restrictive expects
([#2562](#2562))
- feature-gate PostgreSQL tests to remove external dependencies from
`cargo test` ([#2558](#2558))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

3 participants