Commit graph

4367 commits

Author SHA1 Message Date
Rares Mardare
be1dd672df
Prevent AG call refresh if a timeout is already pending + few tweaks to the AG table sizing (#4744)
# What this PR does

- Checks for AG timeout before setting a new one
- Changed table column sizing on a few columns within AG
2024-07-26 09:16:09 +00:00
Dominik Broj
bbde8416c1
change version in package.json to 1.0.0 (#4740)
Related to https://github.com/grafana/irm/issues/25

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-26 08:04:57 +00:00
Vadim Stepanov
eb9e2353b3
Fix N+1 issue on alert group list page (#4738)
# What this PR does

Before:

<img width="267" alt="Screenshot 2024-07-25 at 17 35 28"
src="https://github.com/user-attachments/assets/b0cdcb9d-f658-41cf-9fbb-b61819364dec">

After:
<img width="267" alt="Screenshot 2024-07-25 at 18 11 53"
src="https://github.com/user-attachments/assets/f88c574d-ec9b-4e16-a413-62aa00de6c9a">


## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-25 17:26:05 +00:00
Vadim Stepanov
b408248f35
Enable alert group search by default (#4737)
# What this PR does

Enables free-text search on the alert group page by default (sets the
`FEATURE_ALERT_GROUP_SEARCH_ENABLED` feature flag to `True` by default).

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall/issues/4263 and
https://github.com/grafana/oncall-private/issues/2679

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-25 15:53:12 +00:00
Alyssa Wada
87dd4f90ad
refactor docs configuration section (#4646)
# What this PR does
Restructures OnCall documentation 'Configure' section 

## Which issue(s) this PR closes
Closes issue #4592
2024-07-25 15:22:39 +00:00
Vadim Stepanov
71cdf355db
Force index only on list & stats (#4734)
Following up on https://github.com/grafana/oncall/pull/4731
2024-07-25 13:25:01 +00:00
Dominik Broj
d30d69ba66
Adjustments to IRM unified plugin (#4727)
# What this PR does

- TypeScript version bump 5.1
- Other minor tweaks that are required to successfully build and lint
IRM plugin with oncall code imported

## Which issue(s) this PR closes

Related to https://github.com/grafana/irm/issues/3

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-25 12:19:49 +00:00
Matias Bordese
845940d9b3
Update alert group search to force index in MySQL (#4731)
Related to https://github.com/grafana/oncall-private/issues/2679

Confirmed the query rewriting works via MySQL query logs (index is also
forced for the stats queries):

`2024-07-24T19:50:59.482751Z 3977 Query SELECT `alerts_alertgroup`.`id`
FROM `alerts_alertgroup` FORCE INDEX (`alert_group_list_index`) WHERE
(`alerts_alertgroup`.`channel_id` IN (13) AND (1) AND
(`alerts_alertgroup`.`public_primary_key` LIKE 'test' OR
`alerts_alertgroup`.`inside_organization_number` LIKE 'test' OR
`alerts_alertgroup`.`web_title_cache` LIKE '%test%') AND
`alerts_alertgroup`.`root_alert_group_id` IS NULL AND
((`alerts_alertgroup`.`silenced` = ('0') AND
`alerts_alertgroup`.`acknowledged` = ('0') AND
`alerts_alertgroup`.`resolved` = ('0')) OR
(`alerts_alertgroup`.`acknowledged` = ('1') AND
`alerts_alertgroup`.`resolved` = ('0'))) AND
`alerts_alertgroup`.`started_at` >= '2024-06-24 19:50:58' AND
`alerts_alertgroup`.`started_at` <= '2024-07-24 19:50:58') ORDER BY
`alerts_alertgroup`.`started_at` DESC LIMIT 26
`

Rewriting will only be applied to the alert group search queries, when
the feature flags are enabled. Dependency was already listed as a
requirement.
2024-07-25 09:21:32 +00:00
Yulya Artyukhina
1a6d77888e
Fix notification plan builder (#4726)
# What this PR does
Fixes building notification plan if one or more notifications were
bundled

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-24 15:49:03 +00:00
Gabriel Suela
1622d94d5a
fix: indentation in alert manager integration docs (#4562)
# What this PR does
Fix indentation in alertmanager docs. 

The parts that were adjusted were not following the pattern of the other
examples in the docs.

## Which issue(s) this PR closes

None

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
2024-07-24 14:57:46 +00:00
Vadim Stepanov
b27a158eb0
Fix /escalate predefined org (#4723)
Related to https://github.com/grafana/oncall-gateway/issues/276

Co-authored-by: Innokentii Konstantinov <innokenty.konstantinov@grafana.com>
2024-07-24 10:44:47 +00:00
Innokentii Konstantinov
9da5b94455
Fix app redirect (#4725) 2024-07-24 09:59:56 +00:00
Innokentii Konstantinov
94219c25bb
Introduce slash command matcher (#4717)
With the Unified Slack app we now have two ways of calling commands.
1. Legacy one when command invoked directly: /escalate
2. Unified one: /grafana escalate
On top of that we have different slach commands for each environment:
/escalate-local, /escalate-dev, etc. It was leading to a weird command
to escalate via Unified App in dev u need to type: /grafana-dev
escalate-develop.

To support both, I introduced a matcher function for SlashCommandRoutes.
It allows to simplify handling of such cases without complex workarounds
in an EventAPIEndpoint.


# What this PR does

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-24 09:53:06 +00:00
Rares Mardare
4877b9d927
Set unique key on each rendered route (#4721)
# What this PR does

- Set the unique key on `Expanded` and `Collapsed` containers, otherwise
React has problems figuring out state for each of them when you append a
new route
- Fixed NPE found by Faro
- Tweaked warnings display of `Routing template not set` and `Routing
labels not set`

## Which issue(s) this PR closes

Closes https://github.com/grafana/oncall/issues/4720
2024-07-24 07:48:39 +00:00
Dominik Broj
53556bd98b
show chatops proxy error (#4719)
# What this PR does

show chatops proxy error if present in query params

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-gateway/issues/255

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-24 05:14:02 +00:00
Michael Derynck
ed57c30c24
Prepare for changes to OnCall plugin initialization (#4715)
# What this PR does
Upcoming changes to OnCall plugin initialization will be expecting
`grafana_token` from all requests coming from the OnCall plugin. It is
not currently used it is being added so the plugin can tolerate the
update without errors.

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-23 20:43:28 +00:00
Vadim Stepanov
a53f207355
Alert group search feature flags (#4579)
# What this PR does

Adds two feature flags to experiment with the alert group search feature
(on top of the existing `FEATURE_ALERT_GROUP_SEARCH_ENABLED` flag):
* `FEATURE_ALERT_GROUP_SEARCH_CUTOFF_DAYS` - search window size in days
* `ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX` - enable a workaround
that effectively forces the `alert_group_list_index` index to be used
for alert group list requests

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2679

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-23 16:12:00 +00:00
Rares Mardare
a5587031b1
AG filters (#4718)
# What this PR does

- Refactored filters to allow for easier customization part of
`extraInformation`
- Refactored filters to render with portals
- Always initialize mandatory fields with default values
- Added `TimeRangePickerWrapper` that mimics logic of the same selector
used in Grafana from `@grafana/scenes`, specifically `ScenesTimePicker`

~~- Bumped all `@grafana/*` dependencies to latest version~~ (postponed
to be done in a separate PR)

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall/issues/4464
2024-07-23 13:51:00 +00:00
Dominik Broj
443844348e
hide forbidden actions from Add menu in schedule (#4708)
# What this PR does

hide forbidden actions from Add menu in schedule

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-22 16:26:17 +00:00
Innokentii Konstantinov
1c88107514
Fix slack app redirect (#4714) 2024-07-22 11:04:04 +00:00
Vadim Stepanov
696aca2d80
Make it clear alert groups can't be searched (#4713)
# What this PR does

* Make the filter input say `Filter results...` instead of `Search or
filter results...` on the alert group page; disallow custom input there
so it's only possible to choose among existing filters
* Remove outdated `<page>/filters?search=` functionality from internal
API

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-private/issues/2679

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-22 10:30:28 +00:00
Michael Derynck
ec360f08dd
Fix bug for incorrect arguments used to invoke cleanup_empty_deleted_integrations (#4707)
# What this PR does
- Fixes a bug where cleanup_empty_deleted_integrations was not being
passed the correct arguments
- Removes start_cleanup_organizations now that it is no longer in use

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-19 14:32:22 +00:00
Matias Bordese
ab700fd4a1
Update OrderedModel serializer not to save previously updated order (#4706)
We are noticing some
[issues](https://ops.grafana-ops.net/goto/sQFLv4XSg?orgId=1) when
updating routes via Terraform because when receiving multiple concurrent
requests updating position, the order is updated in a transaction but it
is then tried to save again in the `.save` call, which could lead to
`IntegrityError`s, because the order may have been updated in a
concurrent request meanwhile.

Test run with the reproduced error (before the serializer update):

```
_____________________________ test_ordered_model_swap_all_to_zero_via_serializer _____________________________

    @pytest.mark.django_db(transaction=True)
    def test_ordered_model_swap_all_to_zero_via_serializer():
        THREADS = 300
        exceptions = []
    
        TestOrderedModel.objects.all().delete()  # clear table
        instances = [TestOrderedModel.objects.create(test_field="test") for _ in range(THREADS)]
    
        # generate random non-unique orders
        random.seed(42)
        positions = [random.randint(0, THREADS - 1) for _ in range(THREADS)]
    
        def update_order_to_zero(idx):
            try:
                instance = instances[idx]
                serializer = TestOrderedModelSerializer(
                    instance, data={"order": 0, "extra_field": idx}, partial=True
                )
                serializer.is_valid(raise_exception=True)
                serializer.save()
                instance.swap(positions[idx])
            except Exception as e:
                exceptions.append(e)
    
        threads = [threading.Thread(target=update_order_to_zero, args=(0,)) for _ in range(THREADS)]
        for thread in threads:
            thread.start()
        for thread in threads:
            thread.join()
    
        # can only check that orders are still sequential and that there are no exceptions
        # can't check the exact order because it changes depending on the order of execution
>       assert not exceptions
E       assert not [IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel.unique_test_field_order'"), IntegrityEr...rder'"), IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel.unique_test_field_order'"), ...]

THREADS    = 300
exceptions = [IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel.unique_test_field_order'"), IntegrityEr...rder'"), IntegrityError(1062, "Duplicate entry 'test-0' for key 'base_testorderedmodel.unique_test_field_order'"), ...]
instances  = [<TestOrderedModel: TestOrderedModel object (841)>, <TestOrderedModel: TestOrderedModel object (842)>, <TestOrderedMod...ject (844)>, <TestOrderedModel: TestOrderedModel object (845)>, <TestOrderedModel: TestOrderedModel object (846)>, ...]
positions  = [57, 12, 140, 125, 114, 71, ...]
thread     = <Thread(Thread-302 (update_order_to_zero), stopped 139636013323840)>
threads    = [<Thread(Thread-3 (update_order_to_zero), stopped 139646722418240)>, <Thread(Thread-4 (update_order_to_zero), stopped ...ate_order_to_zero), stopped 139646608590400)>, <Thread(Thread-8 (update_order_to_zero), stopped 139646600197696)>, ...]
update_order_to_zero = <function test_ordered_model_swap_all_to_zero_via_serializer.<locals>.update_order_to_zero at 0x7f02086274c0>

common/tests/test_ordered_model.py:481: AssertionError
```
2024-07-19 11:56:26 +00:00
Matias Bordese
1491e28226
Update regex to jinja route conversion to correctly escape double quotes (#4705)
Related to this
[thread](https://raintank-corp.slack.com/archives/C0229FD3CE9/p1721309907422709).
2024-07-19 11:56:22 +00:00
Vadim Stepanov
87d7982250
Unified Slack app reinstall (#4682)
# What this PR does

Adds a button to reinstall the Slack app to migrate to Unified Slack
App. Also adds backend support for this.

<img width="1204" alt="Screenshot 2024-07-18 at 18 33 08"
src="https://github.com/user-attachments/assets/a326b4a2-fc65-4b88-98c0-2955e3717e3a">


## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall-gateway/issues/252

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-19 11:53:06 +00:00
Innokentii Konstantinov
1465db36e5
Support stack header from chatops-proxy (#4578)
This PR supports new flow of selecting org to run command in a slack
workspace if several stacks are using it. In this case user selects
default stack to run commands or pass a --stack flag. Both handled by
chatops-proxy which injects selected stack as a header.
On a side note - I found one ScenarioStep with incompatible set of
arguments with parent class. I didn't fixed it, just left TODO
https://github.com/grafana/oncall/pull/4578/files#diff-e323b5f38ed665f73d5da3fa0575958ed54ab587f6521b4cd87e1491b5430f8bR364

Related to https://github.com/grafana/oncall-gateway/issues/256

---------

Co-authored-by: Vadim Stepanov <vadimkerr@gmail.com>
2024-07-19 10:08:52 +00:00
Dominik Broj
8d82b078d3
Cleanup and split tiltfile by profiles (#4691)
# What this PR does

Make it possible to select what resources are installed in Tilt by doing
`ONCALL_PROFILES=grafana,plugin,backend,tests tilt up`

## Which issue(s) this PR closes

Related to https://github.com/grafana/irm/issues/3

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-19 05:47:34 +00:00
Matias Bordese
1c33964543
Update schedule events internal API to return default priority level (#4697)
No need to change 0 to `None` in priority level when returning schedule
events (related to this
[thread](https://raintank-corp.slack.com/archives/C0229FD3CE9/p1721239227358309?thread_ts=1721148066.857589&cid=C0229FD3CE9))
2024-07-18 14:15:58 +00:00
Matias Bordese
7777a6003a
Handle multiple unpage event logs when getting paged users (#4698)
Related to https://github.com/grafana/oncall-private/issues/2816
2024-07-18 14:15:48 +00:00
Innokentii Konstantinov
dd84aa15c6
Add missing app_type argument to uninstall request (#4700) 2024-07-18 05:14:52 +00:00
Yulya Artyukhina
4e03732fb1
Drop stale metrics cache (#4695)
# What this PR does
based on this PR - https://github.com/grafana/oncall/pull/4517

## Which issue(s) this PR closes

Related to https://github.com/grafana/oncall/issues/4455

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-17 17:01:04 +00:00
Yulya Artyukhina
49d1127698
Fix send_bundled_notification task (#4696)
# What this PR does
Fix scheduling `perform_notification` from `send_bundled_notification`
task - leftover after resolving merge conflict

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-17 17:00:26 +00:00
Vadim Stepanov
65a794af0a
PR template: "Closes" -> "Related to" (#4693)
Make it so that you need to explicitly use the "Closes" keyword when
opening PRs (as per [this sprint retro
comment](https://miro.com/app/board/uXjVKzhhfgE=/?moveToWidget=3458764594901560846&cot=14))
2024-07-17 13:44:16 +00:00
Rares Mardare
0325e2af02
Label error handling tweaks (#4687)
# What this PR does

These changes make it so that we no longer show an error notification
when you first add an empty pair `key/value` due to the undefined key.
Other than that, the handling remains the same, with some refactorings
as we don't need the try catch clauses.

Would be nice in the future to find a way not to duplicate the usage of
those 2 functions that fetch the key and the value and share them
somehow 🤔
2024-07-17 09:16:27 +00:00
Yulya Artyukhina
35ddfab0e4
Add method to send notification bundle by SMS (#4624)
# What this PR does
Adds method to render and send notification bundle by sms.

Example of SMS message:
```
Grafana OnCall: Alert groups #1, #2, #3 and 2 more 
from stack: TestOrganization, 
integrations: Grafana Alerting and 1 more.
```

Should be merged with https://github.com/grafana/oncall/pull/4457

## Which issue(s) this PR closes
https://github.com/grafana/oncall-private/issues/2713

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-16 14:20:16 +00:00
Michael Derynck
f7e406ca6f
Only run cleanup for integrations deleted recently (#4677)
# What this PR does
Changes operations to cleanup deleted empty integrations so that they
are only performed on organizations that have deleted integrations
recently. The previous task checked everything because we were not
performing the cleanup on a regular basis, now that it has been
scheduled regularly we can operate on recently deleted integrations
instead.

The existing task has been removed from the schedule, the code for it
can be removed after the other tasks have cleared.

## Which issue(s) this PR closes

Closes [issue link here]

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-16 13:59:08 +00:00
Matias Bordese
90dd2115f9
Fix user search param name when adding participants (#4676)
Related to https://github.com/grafana/support-escalations/issues/11505

---------

Co-authored-by: Dominik <dominik.broj@grafana.com>
2024-07-16 11:34:07 +00:00
Yulya Artyukhina
191814b25e
User notifications bundle (#4457)
# What this PR does
This PR adds two new models: UserNotificationBundle and
BundledNotification (proposals for naming are welcome).

`UserNotificationBundle` manages the information about last notification
time and scheduled notification task for bundled notifications. It is
unique per user + notification_channel + notification importance.

`BundledNotification` contains notification policy and alert group, that
triggered the notification. The BundledNotification instance is created
in `notify_user_task` for every notification, that should be bundled,
and is attached to UserNotificationBundle by ForeignKey connection.

How it works:
If the user was notified recently (within the last two minutes) by the
current notification channel, and this channel is bundlable,
BundledNotification instance will be created and attached to the
UserNotificationBundle instance, and `send_bundled_notification` task
will be scheduled to execute in 2 min.
In `send_bundled_notification` task we get all BundledNotification
attached to the current UserNotificationBundle instance, check if alert
groups are still active and if there is only one notification - perform
regular notification by calling `perform_notification` task, otherwise
call "notify_by_<channel>_bundle" method for the current notification
channel.

PR with method to send notification bundle by SMS -
https://github.com/grafana/oncall/pull/4624

**This feature is disabled by default by feature flag. Public docs will
be added in a separate PR with enabling this feature.**
## Which issue(s) this PR closes
related to https://github.com/grafana/oncall-private/issues/2712

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-16 11:24:08 +00:00
Dominik Broj
93a7c645fd
bump nodejs version to latest stable (#4678)
# What this PR does

bump nodejs version to latest stable

## Which issue(s) this PR closes

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-16 11:16:23 +00:00
Dominik Broj
78d2914bb6
explicitly install oncall resources in default namespace (#4675)
# What this PR does

Explicitly install oncall resources in default namespace which helps
running OnCall + Incident via ops-devenv

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-16 07:25:16 +00:00
Matias Bordese
da67c97b8c
Add additional information to the reports script (#4665)
- Flag users missing a required notification method
- Check users have scheduled shifts in non-orphaned (web or terraform)
schedules
- Generate a `teams.csv` file with information about alert groups per
team, and their MTTA and MTTR (in the specified period)
2024-07-15 19:36:41 +00:00
Rares Mardare
7500ff0a8b
Allow submitting forms in the UI by pressing "Enter" (#4674)
# What this PR does

- Escalation Chain and Token forms now use `react-hook-form`

## Which issue(s) this PR closes

Closes https://github.com/grafana/oncall/issues/2038
2024-07-15 12:17:54 +00:00
Rares Mardare
6e3b7774d6
Allow routing via labels on the Integration page (#3850)
# What this PR does

Adds label routing on the UI


![image](https://github.com/user-attachments/assets/f63c11f0-595d-40bf-80be-4e6cbc10a6ea)


![image](https://github.com/user-attachments/assets/2bbdc8b9-0f0d-447d-a4e4-9e9768ed98bf)

## Which issue(s) this PR fixes

Related to https://github.com/grafana/oncall-private/issues/2461

---------

Co-authored-by: Matias Bordese <mbordese@gmail.com>
2024-07-15 07:43:40 +00:00
Dominik Broj
851ca2e12a
Fix Slack channel and user group values not populating on first visit of schedule notification settings (#4671)
# What this PR does

Make sure GSelect gets rerendered with updated items., more context
[here](https://raintank-corp.slack.com/archives/C04JCU51NF8/p1720559481963519)

## Which issue(s) this PR closes

https://github.com/grafana/oncall/issues/4670

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-15 07:15:44 +00:00
Ildar Iskhakov
deff52df07
Add slack button to show log report (#4641)
# What this PR does

Add a button to show an alert group log report in Slack. After deployed
we can remove it from the thread as requested in
https://github.com/grafana/oncall/issues/3849

<img width="534" alt="Screenshot 2024-07-09 at 11 29 48 PM"
src="https://github.com/grafana/oncall/assets/2262529/a17cd366-e97b-4e61-bf06-172fb4737d56">
<img width="673" alt="Screenshot 2024-07-09 at 11 29 57 PM"
src="https://github.com/grafana/oncall/assets/2262529/a67dbe49-1972-45e6-a8b1-ce03ffe6951b">




## Which issue(s) this PR closes

Closes [issue link here]

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-12 09:49:09 +00:00
Vadim Stepanov
324b0c4286
Make docs clearer for "Notify users one by one" policy (#4662)
# What this PR does

Clarifies how the `Notify users one by one (round robin)` escalation
policy works.

## Which issue(s) this PR closes

Related to https://github.com/grafana/support-escalations/issues/11449

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-11 16:47:52 +00:00
Vadim Stepanov
b421296e13
Fix start_sync_org_with_chatops_proxy crontab (#4661)
Related to
https://raintank-corp.slack.com/archives/C04JCU51NF8/p1720695995646029
2024-07-11 16:28:21 +00:00
Matias Bordese
e583d5fc52
Handle inbound email integration alert getting multiple recipients (#4655)
Related to https://github.com/grafana/oncall-private/issues/2683
(when using mailgun backend, you can get multiple recipients, keep the
first one matching the domain; other backends seem to just return the
first one)
2024-07-11 12:51:01 +00:00
Vadim Stepanov
997167fcbe
Fix changing recurrence for weekday masked shifts (#4660)
# What this PR does

Fixes a bug when changing recurrence period for shifts with "Mask by
weekdays" setting enabled breaks the schedule.



https://github.com/grafana/oncall/assets/20116910/396359c5-4ba6-47d7-b003-fea9db709bea



## Which issue(s) this PR closes

Related to https://github.com/grafana/support-escalations/issues/11374

<!--
*Note*: if you have more than one GitHub issue that this PR closes, be
sure to preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-07-11 12:21:12 +00:00
Maxim Mordasov
d7d4a92c28
Enable schedule view e2e test (#4424)
# What this PR does

Enable schedule view e2e test

## Which issue(s) this PR closes

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
Co-authored-by: Dominik Broj <dominik.broj@grafana.com>
2024-07-11 11:50:18 +00:00