oncall-engine/dev/scripts/generate-fake-data
dependabot[bot] 98a8343d83
Bump tqdm from 4.64.1 to 4.66.3 in /dev/scripts/generate-fake-data (#4310)
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.64.1 to 4.66.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tqdm/tqdm/releases">tqdm's
releases</a>.</em></p>
<blockquote>
<h2>tqdm v4.66.3 stable</h2>
<ul>
<li><code>cli</code>: <code>eval</code> safety (fixes CVE-2024-34062,
GHSA-g7vv-2v7x-gj9p)</li>
</ul>
<h2>tqdm v4.66.2 stable</h2>
<ul>
<li><code>pandas</code>: add <code>DataFrame.progress_map</code> (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1549">#1549</a>)</li>
<li><code>notebook</code>: fix HTML padding (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1506">#1506</a>)</li>
<li><code>keras</code>: fix resuming training when
<code>verbose&gt;=2</code> (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1508">#1508</a>)</li>
<li>fix <code>format_num</code> negative fractions missing leading zero
(<a
href="https://redirect.github.com/tqdm/tqdm/issues/1548">#1548</a>)</li>
<li>fix Python 3.12 <code>DeprecationWarning</code> on
<code>import</code> (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1519">#1519</a>)</li>
<li>linting: use f-strings (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1549">#1549</a>)</li>
<li>update tests (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1549">#1549</a>)
<ul>
<li>fix <code>pandas</code> warnings</li>
<li>fix <code>asv</code> (<a
href="https://redirect.github.com/airspeed-velocity/asv/issues/1323">airspeed-velocity/asv#1323</a>)</li>
<li>fix macos <code>notebook</code> docstring indentation</li>
</ul>
</li>
<li>CI: bump actions (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1549">#1549</a>)</li>
</ul>
<h2>tqdm v4.66.1 stable</h2>
<ul>
<li>fix <code>utils.envwrap</code> types (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1493">#1493</a> &lt;-
<a href="https://redirect.github.com/tqdm/tqdm/issues/1491">#1491</a>,
<a href="https://redirect.github.com/tqdm/tqdm/issues/1320">#1320</a>
&lt;- <a
href="https://redirect.github.com/tqdm/tqdm/issues/966">#966</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/1319">#1319</a>)
<ul>
<li>e.g. cloudwatch &amp; kubernetes workaround: <code>export
TQDM_POSITION=-1</code></li>
</ul>
</li>
<li>drop mentions of unsupported Python versions</li>
</ul>
<h2>tqdm v4.66.0 stable</h2>
<ul>
<li>environment variables to override defaults (<code>TQDM_*</code>) (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1491">#1491</a> &lt;-
<a href="https://redirect.github.com/tqdm/tqdm/issues/1061">#1061</a>,
<a href="https://redirect.github.com/tqdm/tqdm/issues/950">#950</a>
&lt;- <a
href="https://redirect.github.com/tqdm/tqdm/issues/614">#614</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/1318">#1318</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/619">#619</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/612">#612</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/370">#370</a>)
<ul>
<li>e.g. in CI jobs, <code>export TQDM_MININTERVAL=5</code> to avoid log
spam</li>
<li>add tests &amp; docs for <code>tqdm.utils.envwrap</code></li>
</ul>
</li>
<li>fix &amp; update CLI completion</li>
<li>fix &amp; update API docs</li>
<li>minor code tidy: replace <code>os.path</code> =&gt;
<code>pathlib.Path</code></li>
<li>fix docs image hosting</li>
<li>release with CI bot account again (<a
href="https://redirect.github.com/cli/cli/issues/6680">cli/cli#6680</a>)</li>
</ul>
<h2>tqdm v4.65.2 stable</h2>
<ul>
<li>exclude <code>examples</code> from distributed wheel (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1492">#1492</a>)</li>
</ul>
<h2>tqdm v4.65.1 stable</h2>
<ul>
<li>migrate <code>setup.{cfg,py}</code> =&gt;
<code>pyproject.toml</code> (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1490">#1490</a>)
<ul>
<li>fix <code>asv</code> benchmarks</li>
<li>update docs</li>
</ul>
</li>
<li>fix snap build (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1490">#1490</a>)</li>
<li>fix &amp; update tests (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1490">#1490</a>)
<ul>
<li>fix flaky notebook tests</li>
<li>bump <code>pre-commit</code></li>
<li>bump workflow actions</li>
</ul>
</li>
</ul>
<h2>tqdm v4.65.0 stable</h2>
<ul>
<li>add Python 3.11 and drop Python 3.6 support (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1439">#1439</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/1419">#1419</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/502">#502</a> &lt;-
<a href="https://redirect.github.com/tqdm/tqdm/issues/720">#720</a>, <a
href="https://redirect.github.com/tqdm/tqdm/issues/620">#620</a>)</li>
<li>misc code &amp; docs tidy</li>
<li>fix &amp; update CI workflows &amp; tests</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4e613f84ed"><code>4e613f8</code></a>
Merge pull request from GHSA-g7vv-2v7x-gj9p</li>
<li><a
href="b53348c730"><code>b53348c</code></a>
cli: eval safety</li>
<li><a
href="cc372d09dc"><code>cc372d0</code></a>
bump version, merge pull request <a
href="https://redirect.github.com/tqdm/tqdm/issues/1549">#1549</a> from
tqdm/devel</li>
<li><a
href="e9f0c05097"><code>e9f0c05</code></a>
use PyPI trusted publishing</li>
<li><a
href="7323d5bcc9"><code>7323d5b</code></a>
slight makefile clean</li>
<li><a
href="5306125133"><code>5306125</code></a>
tests: bump pre-commit</li>
<li><a
href="4a6fd4f690"><code>4a6fd4f</code></a>
fix datetime.utcfromtimestamp py3.12 warning (<a
href="https://redirect.github.com/tqdm/tqdm/issues/1519">#1519</a>)</li>
<li><a
href="6f13759f4a"><code>6f13759</code></a>
tests: fix macos notebook indentation</li>
<li><a
href="3abcd2ac90"><code>3abcd2a</code></a>
tests: fix asv</li>
<li><a
href="a4d15c8e2f"><code>a4d15c8</code></a>
tests: fix pandas warnings</li>
<li>Additional commits viewable in <a
href="https://github.com/tqdm/tqdm/compare/v4.64.1...v4.66.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tqdm&package-manager=pip&previous-version=4.64.1&new-version=4.66.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/grafana/oncall/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2024-05-13 17:11:53 +00:00
..
main.py
README.md
requirements.txt

Fake Data Generator Script

This script can be used to easily populate fake data into your local Grafana/OnCall setup. Currently the script is capable of generating the following objects:

  • teams
  • users
  • schedules
  • schedule on call shifts

Prerequisites

  1. Create/active a Python 3.11 virtual environment
  2. pip install -r requirements.txt
  3. Must have a local version of Grafana and OnCall up and running
  4. Generate an API key inside of Grafana OnCall

How to run

Note: The below flag values assume you are running a grafana container locally via the docker-compose setup. The reason why there is a few separate steps involved is that we need to first create teams and users in the Grafana instance. Later on, in order to create OnCall schedules/oncall-shifts, we need the OnCall user ID to do so. There is currently no way to trigger a Grafana -> OnCall data sync via the public API, hence the manual step in the middle to have data synced between Grafana and OnCall.

  1. Create teams and users in Grafana. The teams and users flags represent the number of teams and users you would like to create respectively:

    # by default this will generate 10 teams and 1000 users
    python main.py generate_teams_and_users
    

    See python main.py generate_teams_and_users -h for more information on how to run the command.

  2. Head to your OnCall setup, and trigger a Grafana -> OnCall data sync by visiting the plugin page.

  3. Create schedules and on call shifts in OnCall. The schedules flag represents the number of OnCall schedules you would like to generate. Note that one on call shift is created for each schedule:

    # by default this will generate 100 schedules
    python main.py generate_schedules_and_oncall_shifts --oncall-api-token=<oncall-api-key>
    

    See python main.py generate_schedules_and_oncall_shifts -h for more information on how to run the command.