mirror of https://github.com/grafana/grafana.git
				
				
				
			Scuemata: Add grafana-cli cue schema validation to CI (#33798)
* Add scuemata validation in CI * Fixes according to reviewer's comments
This commit is contained in:
		
							parent
							
								
									8feeaab996
								
							
						
					
					
						commit
						677b73dda5
					
				
							
								
								
									
										56
									
								
								.drone.yml
								
								
								
								
							
							
						
						
									
										56
									
								
								.drone.yml
								
								
								
								
							|  | @ -95,6 +95,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: gen-version | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -356,6 +363,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: gen-version | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -796,6 +810,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: gen-version | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -1164,6 +1185,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: test-backend-enterprise2 | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -1731,6 +1759,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: gen-version | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -2088,6 +2123,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: test-backend-enterprise2 | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -2645,6 +2687,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: gen-version | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  | @ -2973,6 +3022,13 @@ steps: | |||
|   - initialize | ||||
|   - lint-backend | ||||
| 
 | ||||
| - name: validate-scuemata | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|   - ./bin/linux-amd64/grafana-cli cue validate-schema | ||||
|   depends_on: | ||||
|   - build-backend | ||||
| 
 | ||||
| - name: test-backend-enterprise2 | ||||
|   image: grafana/build-container:1.4.1 | ||||
|   commands: | ||||
|  |  | |||
|  | @ -1110,3 +1110,15 @@ def integration_test_services(edition): | |||
|         }]) | ||||
| 
 | ||||
|     return services | ||||
| 
 | ||||
| def validate_scuemata(): | ||||
|     return { | ||||
|         'name': 'validate-scuemata', | ||||
|         'image': build_image, | ||||
|         'depends_on': [ | ||||
|             'build-backend', | ||||
|         ], | ||||
|         'commands': [ | ||||
|             './bin/linux-amd64/grafana-cli cue validate-schema', | ||||
|         ], | ||||
|     } | ||||
|  |  | |||
|  | @ -33,7 +33,8 @@ load( | |||
|     'publish_packages_step', | ||||
|     'notify_pipeline', | ||||
|     'integration_test_services', | ||||
|     'upload_cdn' | ||||
|     'upload_cdn', | ||||
|     'validate_scuemata' | ||||
| ) | ||||
| 
 | ||||
| ver_mode = 'main' | ||||
|  | @ -52,6 +53,7 @@ def get_steps(edition, is_downstream=False): | |||
|         build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), | ||||
|         build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), | ||||
|         build_plugins_step(edition=edition, sign=True), | ||||
|         validate_scuemata(), | ||||
|     ] | ||||
| 
 | ||||
|     # Have to insert Enterprise2 steps before they're depended on (in the gen-version step) | ||||
|  |  | |||
|  | @ -25,6 +25,7 @@ load( | |||
|     'benchmark_ldap_step', | ||||
|     'ldap_service', | ||||
|     'integration_test_services', | ||||
|     'validate_scuemata', | ||||
| ) | ||||
| 
 | ||||
| ver_mode = 'pr' | ||||
|  | @ -42,6 +43,7 @@ def pr_pipelines(edition): | |||
|         build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants), | ||||
|         build_frontend_step(edition=edition, ver_mode=ver_mode), | ||||
|         build_plugins_step(edition=edition), | ||||
|         validate_scuemata(), | ||||
|     ] | ||||
| 
 | ||||
|     # Have to insert Enterprise2 steps before they're depended on (in the gen-version step) | ||||
|  |  | |||
|  | @ -32,7 +32,8 @@ load( | |||
|     'notify_pipeline', | ||||
|     'integration_test_services', | ||||
|     'publish_packages_step', | ||||
|     'upload_cdn' | ||||
|     'upload_cdn', | ||||
|     'validate_scuemata' | ||||
| ) | ||||
| 
 | ||||
| def release_npm_packages_step(edition, ver_mode): | ||||
|  | @ -76,6 +77,7 @@ def get_steps(edition, ver_mode): | |||
|         build_backend_step(edition=edition, ver_mode=ver_mode), | ||||
|         build_frontend_step(edition=edition, ver_mode=ver_mode), | ||||
|         build_plugins_step(edition=edition, sign=True), | ||||
|         validate_scuemata(), | ||||
|     ] | ||||
| 
 | ||||
|     # Have to insert Enterprise2 steps before they're depended on (in the gen-version step) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue