Skip to content

fix(ci): skip the weekly rules sync when only the timestamp changed - #185

Merged
adityachaudhary-sarvam merged 1 commit into
sarvamai:mainfrom
mangeshraut712:cursor/skip-timestamp-only-sync-4a36
Oct 6, 2026
Merged

adityachaudhary-sarvam merged 1 commit into
sarvamai:mainfrom
mangeshraut712:cursor/skip-timestamp-only-sync-4a36

Conversation

@mangeshraut712

Copy link
Copy Markdown
Contributor

Summary

Fixes #129.

sync_sarvam_rules.py already computes a content fingerprint that ignores synced_at, but main() still wrote scripts/sarvam_api_rules.json on every run. The new timestamp was the only diff, so the Monday workflow opened a pull request that did not change any model or language list.

The script now leaves the file untouched when that fingerprint matches. A real model-list change is still written.

Security checklist (required)

  • No real API keys in code, notebooks, configs, comments, or PR description
  • SARVAM_API_KEY is loaded from the environment — not hardcoded
  • .env is gitignored (new recipes must include .env.example)

New notebook recipe? (if applicable)

Not a recipe change.

Test plan

  • pytest tests/ — all passed
  • A rules file whose only difference is an old synced_at is not rewritten
  • A rules file with an extra model is replaced by the canonical list
  • Ran the example locally with a valid SARVAM_API_KEY — not applicable; this change does not call the API

Related issues

Fixes #129

…change

The weekly sync always wrote sarvam_api_rules.json, including a new
synced_at, so create-pull-request opened a pull request with no rule
changes. Skip the write when the content fingerprint is unchanged.
@mangeshraut712

Copy link
Copy Markdown
Contributor Author

The Monday rules sync was opening a pull request when only synced_at changed. This returns before writing the file when the fingerprint is unchanged. Could a maintainer review when you have a moment?

@adityachaudhary-sarvam

Copy link
Copy Markdown
Collaborator

Hey @mangeshraut712, thanks for the contribution here, really appreciate it 🚀

@adityachaudhary-sarvam
adityachaudhary-sarvam merged commit 9c79b66 into sarvamai:main Oct 6, 2026
1 check passed
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.

Weekly "Sync Sarvam API Rules" job opens a timestamp-only PR every Monday

2 participants