Commit Graph
31 Commits
Author SHA1 Message Date
Loakesh Indiranandhengfei yang 8d234483d2 fix: check invalid stream_name during bulk ingestion (#5403)
#5378

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Enhanced error handling for invalid stream names during ingestion,
ensuring appropriate logging and response for empty or invalid entries.
- Updated assertions in tests to reflect the correct handling of invalid
bulk payloads by the API, ensuring errors are present for invalid
submissions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: hengfei yang <hengfei.yang@gmail.com>
2024-12-18 18:08:31 +05:30
Neha P ec5400e11e test: pytest-scheduled-pipeline (#5385) 2024-12-17 18:10:39 +05:30
Neha P 38ee5dfe0c test: pipeline-api-tests (#5380)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
- Introduced a new end-to-end test for pipeline creation, enabling, and
disabling.
- Utilized parameterization to test various scenarios with different
pipeline names, actions, and expected HTTP status codes.
- Removed the previous end-to-end tests related to user token
management, which included user token retrieval and email verification
processes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-17 16:25:35 +05:30
Neha P 505bd69aa3 test: e2e-enrichment-bulkapi-pytest (#5371)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced end-to-end testing for bulk ingestion with comprehensive
coverage.
- Enhanced functionality for managing enrichment tables, including
adding, uploading, and deleting entries.

- **Bug Fixes**
- Improved error handling and user interaction checks in the enrichment
table upload process.

- **Tests**
- Added multiple new test cases for enrichment table functionality,
including upload and error handling scenarios.
	- Updated existing test cases for consistency and improved logic.

- **Chores**
- Standardized import statements and improved overall test structure for
clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-16 17:13:55 +05:30
Patrick Sullivan faa8929ae1 feat: migrate dashboards out of meta table and into their own table (#5146)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Enhanced dashboard management with new methods for retrieving
properties like ID, owner, title, and description.
- Added functionality for creating, updating, listing, and deleting
dashboards through a new service module.
- Introduced a new `dashboards` table in the database, with migrations
for creation and population.

- **Bug Fixes**
- Improved error handling for dashboard retrieval and management
operations, providing clearer responses for various conditions.

- **Documentation**
- Updated documentation to reflect new methods and error handling
improvements.

- **Refactor**
- Streamlined the dashboard handling logic in service and database
modules, reducing complexity and enhancing modularity.
- Enhanced error handling logic in dashboard management functions for
better clarity and control flow.
- Refined the dashboard retrieval process to improve clarity in control
flow and error handling.
- Updated the logic for dashboard operations to simplify version
handling and reduce redundancy.
- Improved the overall structure and organization of the dashboard
management code.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-11-26 19:22:40 -08:00
Patrick Sullivan 46cce3de59 feat: JSON-indpendent hashing of dashboard models (#5133)
The previous mechanism for generating hashes for dashboard models
depended on hashing the JSON representation of the dashboard that was
stored in the `meta` table.

As part of the migration of dashboards out of the `meta` table and into
a dedicated `dashboards` table, this ☝️ presented some problems:

Specifically when we want to translate from the Dashboard ORM model to a
`core::meta::dashboards::Dashboard` model, we need to generate the hash
at the time of translation since `hash` is a field on
`core::meta::dashboards::Dashboard`. We can't simply generate a hash
from the JSON stored in the `dashboards.data` column because this JSON
no longer contains fields for `title`, `owner`, `description`, and
`role`. Those fields are now stored in DB columns, and changes to those
columns in the DB columns would *not* result in changes to the hash on
the JSON blob.

Therefore, rather than hashing the JSON blob, this PR implements hash
functions on the Rust types for the dashboards. Therefore changes to
fields in those Rust structs will result in changes to the hash values,
but changes to the way in which the data is stored in the DB will not
affect the hash values.

⚠️ Note that this PR is changing the hash function on the dashboard
models, so hashes generated for the same model before and after this
deployment will not be the same. My understanding is that this shouldn't
be an issue since hashes are just used as a way of checking on the UI if
the dashboard model has been updated to avoid overwriting the changes of
another user. I believe that this change to the dashboard function might
just have the effect (around the time of deployment) where it would
appear to the UI that the dashboard has been updated when, in fact, it
has not.

https://github.com/openobserve/o2-enterprise/actions/runs/11979723563

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new type alias `OrdF64` for enhanced precision in
floating-point operations.
- Added the `Hash` trait to multiple dashboard-related structs and
enums, enabling their use in hash-based collections.

- **Bug Fixes**
- Improved error handling and assertion clarity in API testing for
folder and dashboard operations.

- **Chores**
- Standardized hashing mechanism for dashboard objects in database
operations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-11-25 10:23:38 -06:00
Neha P 8fb58346a1 test: pytest-join-queries testcases (#5128)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new JSON file for SQL join query test cases, enhancing
the variety and coverage of tests.
- Added multiple new test cases for various SQL join operations,
improving testing capabilities.

- **Bug Fixes**
- Improved error handling in data ingestion steps to ensure successful
test execution.

- **Refactor**
- Transitioned from hardcoded test data to a parameterized approach for
better maintainability and flexibility in testing.
	- Updated method signature to streamline test parameters.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-11-22 18:05:24 +05:30
0ebaf21f33 feat: Pipeline integration v2 (#4732)
This PR implements the new design of **Pipeline** introduced by #4432 

---

**2 types of pipelines differentiates by the source** 

Type I: **Realtime**
- source is a stream (Logs, Metrics, & Traces)
- takes effect when the source stream is being ingested

Type II: **Scheduled** (aka DerivedSteram)
- source is a SQL query
- takes effect based on the given schedule

The new pipeline is represented as a graph consists of different types
of Nodes that are connected by edges.
**Pipeline Data Model**
```rs
pub struct Pipeline {
    pub id: String,
    pub version: i32,
    pub enabled: bool,
    pub org: String,
    pub name: String,
    pub description: String,
    pub source: PipelineSource,
    pub nodes: Vec<Node>,
    pub edges: Vec<Edge>,
}
```
**4 types of node**
I. StreamNode: either used for source node of realtime pipeline or for
destination nodes
II. QueryNode: used for source node of scheduled pipeline
III. FunctionNode: used for executing vrl functions
IV. ConditionNode: used for checking routing conditions

Rules applied to validating a pipeline when it's created:
1. non-empty nodes list
2. non-empty edges list
3. 1st node in nodes list is either StreamNode or QueryNode
4. non-empty `conditions` in all ConditionNode nodes in nodes list
5. all leaf nodes are of type StreamNode
6. In the same branch, unchecked `after_flattened` FunctionNode can't
follow checked
   `after_flattened` checked FunctionNode

Pipeline execution is implemented with the struct `ExecutablePipeline`,
a ready-execute pipeline object cached in memory based on the Pipeline
objects modified on the UI side.
`ExecutablePipeline` object
- builds the relationships among all the nodes based on the edges
- topologically sorts the nodes based on the level to determine which
node to process first
- registers all the vrl function node once

`ExecutablePipeline` object processes ingested records in batch.
Starting from the source node, each connecting edge has a channel
connecting the parent and child node, used for passing the records. This
approach enables batch processing in parallel.

---

**Deprecated Features**
1. previous implementation of pipeline
2. Function x Stream associations
 - Functions can still be added/edited/removed as before
- Needs to create a pipeline in order to apply chosen functions to the
desired stream

The new release when this pr is merged will automatically migrate **old
pipelines** and **Function x Stream associations** to new pipeline
format and can be found in `Stream Pipelines` tab with `Migrated-`
prefix names.
**_Note: Auto generated pipelines are paused by default. Please verify
the pipelines before enabling them_**


Co-authored-by: Taiming Liu <liutaiming3@gmail.com>
Co-authored-by: Bhargav <BJP232004@GMAIL.COM>
2024-10-30 21:53:28 -07:00
ShyamOOAI fc321fd294 test: try_cast test cases (#4939)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
- Introduced a new parameterized test suite for validating SQL queries
involving `cast` and `try_cast` operations.
- Enhanced testing framework to ensure API reliability when handling
various SQL casting scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-10-29 13:21:21 +05:30
Neha P 3d5d1a8f89 test: join queries testcases (#4910)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
- Introduced a series of end-to-end tests for SQL queries with various
join types to ensure functionality against the API.
- Added tests for `LIKE`, inner join, `IN`, left join, right join, and
full join SQL queries.
- Implemented parameterized testing for improved coverage and
maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-10-25 15:30:29 +05:30
Neha P f5412c7528 test: added multiple float queries in pytest under alert and logs (#4909)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added end-to-end tests for creating alerts based on SQL and float
values.
- Introduced a page object model for unflattened logs to streamline UI
interactions.
	- Implemented a function to toggle quick mode in the test suite.

- **Bug Fixes**
	- Enhanced error handling and validation in alert tests.
- Improved reliability of tests by ensuring UI elements are visible
before interactions.

- **Refactor**
- Refactored Playwright tests to utilize the `UnflattenedPage` object
for better maintainability.
	- Consolidated parameters in fetch requests for clarity.

- **Chores**
- Removed redundant tests from the alert test suite to improve clarity
and maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-10-25 13:09:15 +05:30
65fae0b89f feat: hash check when updating dashboards (#4687)
impl #4703 

---------

Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech>
2024-10-06 22:59:28 -07:00
Hengfei Yang d1ed457369 feat: new search engine (#4182) 2024-09-20 15:10:54 +08:00
Yashodhan Joshi d45ac8f9ad fix: unify the trace ingestion handling (#4435) 2024-09-05 13:33:15 +08:00
Neha P c8059c4ed8 test: api test search queries (#4454)
Added more queries
Added test for match_all single character #4439

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Enhanced SQL query testing with a new data source, improving test
accuracy.
- Introduced multiple new test functions for comprehensive SQL
functionality coverage, including counting and coalescing.

- **Bug Fixes**
- Updated existing tests to align with the new data source, ensuring
reliable query validation.

- **Refactor**
- Replaced and renamed tests to reflect changes in the data source and
improve clarity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-09-04 12:55:34 +05:30
Hengfei Yang 8a0dbe2cf4 feat: remove sql_mode, query_context and aggs from search API (#4089) 2024-07-31 11:23:11 +08:00
Neha P 22a3c11fdd test: assert records to be unique (#4014)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced enhanced test functions for more precise SQL queries,
improving the validation of result cache ratios.
- Added a new test for executing multiple SQL queries simultaneously,
expanding test coverage.

- **Bug Fixes**
- Updated assertions in existing tests to align with new query
structures and expected values.

- **Chores**
- Both new test functions are currently marked as skipped, indicating
they are not ready for execution.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-19 17:59:30 +05:30
Neha P d6ab1a9933 test: inverted index testcases (#3920)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
  - Added end-to-end test functions to validate SQL query handling.
  - Introduced new log entry for end-to-end test tracking.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-08 13:11:22 +05:30
Neha P 3763e31f28 test: api-search-tests (#3863)
- Fixed some breaking api tests

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
- Updated end-to-end tests related to SQL queries by commenting out
specific test functions.
- Enhanced SQL queries in tests with `ORDER BY` clauses for more precise
results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-07-01 15:16:01 +05:30
Neha P c79240c6db test: e2e-cache-data-scenario (#3848)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Tests**
- Introduced an end-to-end test for SQL query caching to improve
reliability.
- Modified a UI test description and marked it as skipped for future
refinement.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-29 10:32:39 +05:30
Neha P 37722098ff test: pytest logs search queries (#3727)
- Added more search queries under pytest

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Tests**
- Added new end-to-end test functions for various SQL queries, including
count aggregation, match, max, in, and distinct queries, to ensure API
reliability and accuracy.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-06-12 17:08:09 +05:30
Taiming Liu 51d6c8e077 fix: inverted index query count (#3627) 2024-06-03 14:17:04 +08:00
Ashish Kolhe beeec9143f fix: revert renaming match_all (#3645)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Enhanced search functionality with indexed matching options.

- **Bug Fixes**
  - Updated SQL queries in tests to align with new matching functions.

- **Improvements**
- Standardized naming conventions for matching functions to improve
clarity and consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-05-31 14:36:52 +05:30
Taiming Liu fc05d06c9a refactor: rename match_all & match_all_indexed (#3613)
match_all                  renamed to match_all_raw
match_all_indexed   renamed to match_all

same pattern applied to *_ignore_case functions

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved clarity in function names for better understanding and
usability.

- **Tests**
- Updated SQL queries in test cases to reflect changes in function
names, ensuring accurate test results.

- **Chores**
- Adjusted logging statements to provide better insights during
debugging.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-05-28 14:04:36 -07:00
Hengfei Yang fd49360f49 feat: add quick mode fields (#3068) 2024-03-22 15:54:39 +08:00
Neha Pandktx-vaidehi 48b5247126 test: added aggregation queries and folders testcase fix (#3064)
- added search API tests for aggregation queries
- fixed dashboard-folders tests

---------

Co-authored-by: ktx-vaidehi <vaidehi.akhani@kiara.tech>
2024-03-21 18:19:20 +05:30
Neha PandAnkur Srivastava 53a7884302 test: added testcase for search queries (#3046)
- added match all valid cases for histogram and sql
- match_all_indexed cases for histogram and sql
- match_all_ignore case for histogram and sql
- match_all_indexed_ignorecase for histogram and sql

---------

Co-authored-by: Ankur Srivastava <best.ankur@gmail.com>
2024-03-20 20:09:49 +01:00
d686481569 test: prepopulate the amount of data for each test #3000 (#3031)
Created a fixture which will be available during scope=session. This
will ingest data present in tests/test-data/logs_data.json to
org_pytest_data and stream_pytest_data

API Tests positive and negative scenarios - 
- Search without payload
- Search with valid sql query
- search with invalid sql query
- search with limit and sql query
- valid histogram query
- histogram query with limit

---------

Co-authored-by: Neha P <neha@openobserve.ai>
Co-authored-by: Neha P <144308844+neha00290@users.noreply.github.com>
2024-03-18 16:38:56 +01:00
Ashish Kolhe da08a7f5e8 feat: rebac with openfga (#2452) 2024-01-11 20:40:17 +05:30
Juan Calderon-Perez 66968e8265 refactor: API Integration Tests workflow (#2324)
- Simplify the API integration tests by removing steps not needed (Node,
k8s, building docker, etc).
- Testing the UI, linting, formatting, etc should be done in a separate
workflow file
- Simplify Rust cache workflow.
  - By default it caches /target
- Removed Dockerfile and k8s deployment from CI.
  - You can just run `OpenObserve` in the background
- Replace `ubicloud-standard-16` with `ubuntu-latest` which is *FREE*.
  - Using 16 cores, 64GB of ram is an overkill for running tests.
- Don't run the CI if changes to `.md` files are detected.

Notes:
- Before caching building `OpenObserve` takes around 5-7 mins, after
cache it goes down to 1-2 mins.
2023-12-29 07:39:09 +01:00
Ankur Srivastavaandneha00290 2c319d9c6f feat: integrate API integration testing using pytest (#2250)
Co-authored-by: neha00290 <neha@openobserve.ai>
2023-12-27 16:59:41 +01:00