Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the breaking change with the last version of grafana lib #24

Open
idrissneumann opened this issue Nov 22, 2023 · 1 comment
Open

Comments

@idrissneumann
Copy link
Collaborator

On the github action of all opening pull requests:

Screenshot 2023-11-22 at 15 48 20

But if you upgrade the dependancy to 10.2.2, you'll see a huge amount of breaking changes to fix:

assets by status 814 KiB [cached] 10 assets
orphan modules 516 KiB [orphan] 258 modules
runtime modules 1.13 KiB 5 modules
built modules 354 KiB [built]
  modules by path external "@grafana/ 126 bytes
    external "@grafana/data" 42 bytes [built] [code generated]
    external "@grafana/runtime" 42 bytes [built] [code generated]
    external "@grafana/ui" 42 bytes [built] [code generated]
  ./module.ts + 90 modules 353 KiB [built] [code generated]
  external "lodash" 42 bytes [built] [code generated]
  external "rxjs" 42 bytes [built] [code generated]
  external "react" 42 bytes [built] [code generated]
  external "@emotion/css" 42 bytes [built] [code generated]
  external "redux" 42 bytes [built] [code generated]

ERROR in ./src/components/QueryEditor/index.tsx:21:56
TS2344: Type 'QuickwitDataSource' does not satisfy the constraint 'DataSourceApi<Elasticsearch, QuickwitOptions, {}>'.
  Types of property 'importQueries' are incompatible.
    Type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-...' is not assignable to type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery...'.
    19 | import { QueryTypeSelector } from './QueryTypeSelector';
    20 |
  > 21 | export type ElasticQueryEditorProps = QueryEditorProps<ElasticDatasource, ElasticsearchQuery, QuickwitOptions>;
       |                                                        ^^^^^^^^^^^^^^^^^
    22 |
    23 | export const QueryEditor = ({ query, onChange, onRunQuery, datasource, range, app }: ElasticQueryEditorProps) => {
    24 |   return (

ERROR in ./src/components/QueryEditor/index.tsx:53:29
TS2345: Argument of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { root: string; queryItem: string; }' is not assignable to parameter of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { root: string; queryItem: string; }'.
  Types of parameters 'theme' and 'theme' are incompatible.
    Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2'.
    51 |
    52 | export const ElasticSearchQueryField = ({ value, onChange }: { value?: string; onChange: (v: string) => void }) => {
  > 53 |   const styles = useStyles2(getStyles);
       |                             ^^^^^^^^^
    54 |
    55 |   return (
    56 |     <div className={styles.queryItem}>

ERROR in ./src/components/QueryEditor/index.tsx:73:29
TS2345: Argument of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { root: string; queryItem: string; }' is not assignable to parameter of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { root: string; queryItem: string; }'.
    71 |   const dispatch = useDispatch();
    72 |   const nextId = useNextId();
  > 73 |   const styles = useStyles2(getStyles);
       |                             ^^^^^^^^^
    74 |
    75 |   const showBucketAggregationsEditor = value.metrics?.every(
    76 |     (metric) => metricAggregationConfig[metric.type].impliedQueryType === 'metrics'

ERROR in ./src/components/QueryEditor/MetricAggregationsEditor/MetricEditor.tsx:55:28
TS2345: Argument of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2' is not assignable to parameter of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2'.
    53 |
    54 | export const MetricEditor = ({ value }: Props) => {
  > 55 |   const styles = getStyles(useTheme2(), !!value.hide);
       |                            ^^^^^^^^^^^
    56 |   const query = useQuery();
    57 |   const dispatch = useDispatch();
    58 |   const getFields = useFields(value.type);

ERROR in ./src/components/QueryEditor/QueryEditorRow.tsx:22:29
TS2345: Argument of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { iconWrapper: string; icon: string; }' is not assignable to parameter of type '(theme: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2) => { iconWrapper: string; icon: string; }'.
  Types of parameters 'theme' and 'theme' are incompatible.
    Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2'.
      The types of 'colors.primary' are incompatible between these types.
        Property 'borderTransparent' is missing in type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ThemeRichColor' but required in type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ThemeRichColor'.
    20 |   hidden = false,
    21 | }: PropsWithChildren<Props>) => {
  > 22 |   const styles = useStyles2(getStyles);
       |                             ^^^^^^^^^
    23 |
    24 |   return (
    25 |     <InlineFieldRow>

ERROR in ./src/components/QueryEditor/SettingsEditorContainer.tsx:41:28
TS2345: Argument of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").GrafanaTheme2' is not assignable to parameter of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").GrafanaTheme2'.
    39 |
    40 |   const theme = useTheme2();
  > 41 |   const styles = getStyles(theme, hidden);
       |                            ^^^^^
    42 |
    43 |   return (
    44 |     <InlineSegmentGroup>

ERROR in ./src/datasource.ts:174:3
TS2416: Property 'getDataProvider' in type 'QuickwitDataSource' is not assignable to the same property in base type 'DataSourceWithSupplementaryQueriesSupport<Elasticsearch>'.
  Type '(type: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").SupplementaryQueryType, request: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/src/dataquery.gen").Elasticsearch>) => import("/...' is not assignable to type '(type: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").SupplementaryQueryType, request: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/src/dataquery.gen").Elasticsearch>) => import("/...'. Two different types with this name exist, but they are unrelated.
    Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryResponse> | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryResponse> | undefined'.
      Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryResponse>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryResponse>'.
        Types of property 'source' are incompatible.
          Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined'.
            Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<any>'.
              Types of property 'operator' are incompatible.
                Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined'.
                  Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>'.
                    Types of property 'call' are incompatible.
                      Type '(subscriber: import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/types").TeardownLogic'.
                        Types of parameters 'subscriber' and 'subscriber' are incompatible.
                          Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>'.
                            Property 'isStopped' is protected but type 'Subscriber<T>' is not a class derived from 'Subscriber<T>'.
    172 |    * supplementary query type and original request.
    173 |    */
  > 174 |   getDataProvider(
        |   ^^^^^^^^^^^^^^^
    175 |     type: SupplementaryQueryType,
    176 |     request: DataQueryRequest<ElasticsearchQuery>
    177 |   ): Observable<DataQueryResponse> | undefined {

ERROR in ./src/datasource.ts:266:7
TS2345: Argument of type 'this' is not assignable to parameter of type 'DataSourceApi<Elasticsearch, QuickwitOptions, {}>'.
  Type 'QuickwitDataSource' is not assignable to type 'DataSourceApi<Elasticsearch, QuickwitOptions, {}>'.
    Types of property 'importQueries' are incompatible.
      Type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-...' is not assignable to type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery...'.
        Type '(queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-d...' is not assignable to type '(queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery,...'.
          Types of parameters 'originDataSource' and 'originDataSource' are incompatible.
            Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceJsonData, {}>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafan...'.
              Types of property 'importQueries' are incompatible.
                Type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery...' is not assignable to type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-...'.
                  Type '(queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery,...' is not assignable to type '(queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-d...'.
                    Types of parameters 'originDataSource' and 'originDataSource' are incompatible.
                      Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafan...' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceJsonData, {}>'.
                        Types of property 'query' are incompatible.
                          Type '(request: DataQueryRequest<DataQuery>) => Observable<DataQueryResponse> | Promise<DataQueryResponse>' is not assignable to type '(request: DataQueryRequest<DataQuery>) => Promise<DataQueryResponse> | Observable<DataQueryResponse>'.
                            Types of parameters 'request' and 'request' are incompatible.
                              Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery>'.
                                The types of 'scopedVars.__dataContext' are incompatible between these types.
                                  Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataContextScopedVar | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataContextScopedVar | undefined'.
                                    Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataContextScopedVar' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataContextScopedVar'.
                                      The types of 'value.frame.fields' are incompatible between these types.
                                        Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").Field<any, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").Vector<any>>[]' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").Field<any, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").Vector<any>>[]'.
                                          Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").Field<any, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").Vector<any>>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").Field<any, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").Vector<any>>'.
                                            Types of property 'type' are incompatible.
                                              Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").FieldType' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").FieldType'.
                                                Property 'nestedFrames' is missing in type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").FieldType'.
    264 |
    265 |     return queryLogsVolume(
  > 266 |       this,
        |       ^^^^
    267 |       { ...logsVolumeRequest, targets },
    268 |       {
    269 |         range: request.range,

ERROR in ./src/datasource.ts:488:18
TS2345: Argument of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/src/dataquery.gen").Elasticsearch>' is not assignable to parameter of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQueryRequest<import("/Users/ineumann/quickwit-datasource/src/dataquery.gen").Elasticsearch>'.
  Types of property 'scopedVars' are incompatible.
    Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ScopedVars' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ScopedVars'.
    486 |
    487 |     return lastValueFrom(
  > 488 |       this.query(contextRequest).pipe(
        |                  ^^^^^^^^^^^^^^
    489 |         catchError((err) => {
    490 |           const error: DataQueryError = {
    491 |             message: 'Error during context query. Please check JS console logs.',

ERROR in ./src/datasource.ts:539:50
TS2345: Argument of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ScopedVars | undefined' is not assignable to parameter of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ScopedVars | undefined'.
  Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ScopedVars' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ScopedVars'.
    537 |
    538 |   interpolateLuceneQuery(queryString: string, scopedVars?: ScopedVars) {
  > 539 |     return this.templateSrv.replace(queryString, scopedVars, formatQuery);
        |                                                  ^^^^^^^^^^
    540 |   }
    541 |
    542 |   interpolateVariablesInQueries(queries: ElasticsearchQuery[], scopedVars: ScopedVars | {}): ElasticsearchQuery[] {

ERROR in ./src/datasource.ts:547:3
TS2416: Property 'applyTemplateVariables' in type 'QuickwitDataSource' is not assignable to the same property in base type 'DataSourceWithBackend<Elasticsearch, QuickwitOptions>'.
  Type '(query: Elasticsearch, scopedVars: ScopedVars) => Elasticsearch' is not assignable to type '(query: Elasticsearch, scopedVars: ScopedVars) => Record<string, any>'.
    Types of parameters 'scopedVars' and 'scopedVars' are incompatible.
      Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ScopedVars' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ScopedVars'.
        Types of property '__dataContext' are incompatible.
          Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataContextScopedVar | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataContextScopedVar | undefined'.
            Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataContextScopedVar' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataContextScopedVar'.
              Types of property 'value' are incompatible.
                Property 'data' is missing in type '{ frame: DataFrame; field: Field<any, Vector<any>>; rowIndex?: number | undefined; calculatedValue?: DisplayValue | undefined; }' but required in type '{ data: DataFrame[]; frame: DataFrame; field: Field<any, Vector<any>>; rowIndex?: number | undefined; frameIndex?: number | undefined; calculatedValue?: DisplayValue | undefined; }'.
    545 |
    546 |   // Used when running queries through backend
  > 547 |   applyTemplateVariables(query: ElasticsearchQuery, scopedVars: ScopedVars): ElasticsearchQuery {
        |   ^^^^^^^^^^^^^^^^^^^^^^
    548 |     // We need a separate interpolation format for lucene queries, therefore we first interpolate any
    549 |     // lucene query string and then everything else
    550 |     const interpolateBucketAgg = (bucketAgg: BucketAggregation): BucketAggregation => {

ERROR in ./src/datasource.ts:574:91
TS2345: Argument of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").ScopedVars' is not assignable to parameter of type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").ScopedVars'.
    572 |     };
    573 |
  > 574 |     const finalQuery = JSON.parse(this.templateSrv.replace(JSON.stringify(expandedQuery), scopedVars));
        |                                                                                           ^^^^^^^^^^
    575 |     return finalQuery;
    576 |   }
    577 | }

ERROR in ./src/datasource.ts:625:80
TS2345: Argument of type 'Promise<DataQueryResponse> | Observable<DataQueryResponse>' is not assignable to parameter of type 'ObservableInput<any>'.
  Type 'Observable<DataQueryResponse>' is not assignable to type 'ObservableInput<any>'.
    Type 'Observable<DataQueryResponse>' is not assignable to type 'Observable<any>'.
      Types of property 'source' are incompatible.
        Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<any> | undefined'.
          Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Observable").Observable<any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Observable").Observable<any>'.
            Types of property 'operator' are incompatible.
              Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any> | undefined'.
                Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Operator").Operator<any, any>'.
                  Types of property 'call' are incompatible.
                    Type '(subscriber: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/types").TeardownLogic' is not assignable to type '(subscriber: import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>, source: any) => import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/types").TeardownLogic'.
                      Types of parameters 'subscriber' and 'subscriber' are incompatible.
                        Type 'import("/Users/ineumann/quickwit-datasource/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/node_modules/rxjs/dist/types/internal/Subscriber").Subscriber<any>'.
                          Property 'isStopped' is protected but type 'Subscriber<T>' is not a class derived from 'Subscriber<T>'.
    623 |
    624 |     const queryResponse = datasource.query(logsVolumeRequest);
  > 625 |     const queryObservable = isObservable(queryResponse) ? queryResponse : from(queryResponse);
        |                                                                                ^^^^^^^^^^^^^
    626 |
    627 |     const subscription = queryObservable.subscribe({
    628 |       complete: () => {

ERROR in ./src/LanguageProvider.ts:9:3
TS2416: Property 'datasource' in type 'ElasticsearchLanguageProvider' is not assignable to the same property in base type 'LanguageProvider'.
  Type 'QuickwitDataSource' is not assignable to type 'DataSourceApi<any, any, {}>'.
    Types of property 'importQueries' are incompatible.
      Type '((queries: DataQuery[], originDataSource: DataSourceApi<DataQuery, DataSourceJsonData, {}>) => Promise<Elasticsearch[]>) | undefined' is not assignable to type '((queries: DataQuery[], originDataSource: DataSourceApi<DataQuery, DataSourceJsonData, {}>) => Promise<any[]>) | undefined'.
        Type '(queries: DataQuery[], originDataSource: DataSourceApi<DataQuery, DataSourceJsonData, {}>) => Promise<Elasticsearch[]>' is not assignable to type '(queries: DataQuery[], originDataSource: DataSourceApi<DataQuery, DataSourceJsonData, {}>) => Promise<any[]>'.
          Types of parameters 'originDataSource' and 'originDataSource' are incompatible.
            Type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceJsonData, {}>' is not assignable to type 'import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery, import("/Users/ineumann/quickwit-datasource/node_modules/@grafan...'.
     7 |   declare request: (url: string, params?: any) => Promise<any>;
     8 |   declare start: () => Promise<any[]>;
  >  9 |   datasource: ElasticDatasource;
       |   ^^^^^^^^^^
    10 |
    11 |   constructor(datasource: ElasticDatasource, initialValues?: any) {
    12 |     super();

ERROR in ./src/module.ts:8:44
TS2344: Type 'QuickwitDataSource' does not satisfy the constraint 'DataSourceApi<Elasticsearch, QuickwitOptions, {}>'.
  Types of property 'importQueries' are incompatible.
    Type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/runtime/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-...' is not assignable to type '((queries: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery[], originDataSource: import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataSourceApi<import("/Users/ineumann/quickwit-datasource/node_modules/@grafana/data/dist/index").DataQuery...'.
     6 | import { QuickwitOptions } from 'quickwit';
     7 |
  >  8 | export const plugin = new DataSourcePlugin<QuickwitDataSource, ElasticsearchQuery, QuickwitOptions>(QuickwitDataSource)
       |                                            ^^^^^^^^^^^^^^^^^^
     9 |   .setConfigEditor(ConfigEditor)
    10 |   .setQueryEditor(QueryEditor);

We're opening this issue for fixing all those breaking changes

@fmassot
Copy link
Contributor

fmassot commented Nov 22, 2023

I had a look at the changes made on the elasticsearch plugin and I think we can upgrade grafana libs to version 10.

We can also check this: https://grafana.com/developers/plugin-tools/migration-guides/update-from-grafana-versions/migrate-9_x-to-10_x

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

No branches or pull requests

2 participants