Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature_2729_tc_diag
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed May 8, 2024
2 parents a2a295d + 542b4ba commit 09bdbf6
Show file tree
Hide file tree
Showing 598 changed files with 12,625 additions and 9,592 deletions.
2 changes: 1 addition & 1 deletion .github/jobs/build_docker_image.sh
Expand Up @@ -15,7 +15,7 @@ time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg MET_CONFIG_OPTS \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
cat ${GITHUB_WORKSPACE}/docker_build.log
cat ${CMD_LOGFILE}
exit 1
fi

Expand Down
45 changes: 45 additions & 0 deletions .github/jobs/build_sonarqube_image.sh
@@ -0,0 +1,45 @@
#! /bin/bash

source ${GITHUB_WORKSPACE}/.github/jobs/bash_functions.sh

DOCKERHUB_TAG=met-sonarqube-gha

DOCKERFILE_PATH=${GITHUB_WORKSPACE}/internal/scripts/docker/Dockerfile.sonarqube

CMD_LOGFILE=${GITHUB_WORKSPACE}/sonarqube_build.log

#
# Define the $SONAR_REFERENCE_BRANCH as the
# - Target of any requests
# - Manual setting for workflow dispatch
# - Source branch for any pushes (e.g. develop)
#
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
export SONAR_REFERENCE_BRANCH=${GITHUB_BASE_REF}
elif [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then
export SONAR_REFERENCE_BRANCH=${WD_REFERENCE_BRANCH}
else
export SONAR_REFERENCE_BRANCH=${SOURCE_BRANCH}
fi

echo SONAR_REFERENCE_BRANCH=${SONAR_REFERENCE_BRANCH}

time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg MET_BASE_REPO \
--build-arg MET_BASE_TAG \
--build-arg SOURCE_BRANCH \
--build-arg SONAR_SCANNER_VERSION \
--build-arg SONAR_HOST_URL \
--build-arg SONAR_TOKEN \
--build-arg SONAR_REFERENCE_BRANCH \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
if [ $? != 0 ]; then
cat ${CMD_LOGFILE}
exit 1
fi

# Copy the .scannerwork directory from the image
id=$(docker create ${DOCKERHUB_TAG})
time_command mkdir -p /tmp/scannerwork
time_command docker cp $id:/met/.scannerwork/report-task.txt /tmp/scannerwork/report-task.txt
docker rm -v $id
8 changes: 7 additions & 1 deletion .github/pull_request_template.md
Expand Up @@ -16,9 +16,15 @@ If **yes**, please describe:</br>

- [ ] Do these changes include sufficient testing updates? **[Yes or No]**

- [ ] Will this PR result in changes to the test suite? **[Yes or No]**</br>
- [ ] Will this PR result in changes to the MET test suite? **[Yes or No]**</br>
If **yes**, describe the new output and/or changes to the existing output:</br>

- [ ] Will this PR result in changes to existing METplus Use Cases? **[Yes or No]**</br>
If **yes**, create a new **Update Truth** [METplus issue](https://github.com/dtcenter/METplus/issues/new/choose) to describe them.

- [ ] Do these changes introduce new SonarQube findings? **[Yes or No]**</br>
If **yes**, please describe:

- [ ] Please complete this pull request review by **[Fill in date]**.</br>

## Pull Request Checklist ##
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/sonarqube.yml
@@ -0,0 +1,91 @@
name: SonarQube Scan

# Run SonarQube for Pull Requests and changes to the develop and main_vX.Y branches

on:

# Trigger analysis for pushes to develop and main_vX.Y branches
push:
branches:
- develop
- 'main_v**'
paths-ignore:
- 'docs/**'
- '.github/pull_request_template.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/labels/**'
- '**/README.md'
- '**/LICENSE.md'

# Trigger analysis for pull requests to develop and main_vX.Y branches
pull_request:
types: [opened, synchronize, reopened]
branches:
- develop
- 'main_v**'
paths-ignore:
- 'docs/**'
- '.github/pull_request_template.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/labels/**'
- '**/README.md'
- '**/LICENSE.md'

workflow_dispatch:
inputs:
reference_branch:
description: 'Reference Branch'
default: develop
type: string

jobs:
build:
name: SonarQube Scan
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
with:
# Disable shallow clones for better analysis
fetch-depth: 0

- name: Create output directories
run: mkdir -p ${RUNNER_WORKSPACE}/logs

- name: Get branch name
id: get_branch_name
run: echo branch_name=${GITHUB_REF#refs/heads/} >> $GITHUB_OUTPUT

- name: SonarQube Scan in Docker
run: .github/jobs/build_sonarqube_image.sh
env:
MET_BASE_REPO: met-base
MET_BASE_TAG: v3.2
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}
WD_REFERENCE_BRANCH: ${{ github.event.inputs.reference_branch }}
SONAR_SCANNER_VERSION: 5.0.1.3006
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: SonarQube Quality Gate check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
with:
scanMetadataReportFile: /tmp/scannerwork/report-task.txt
timeout-minutes: 5
env:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Copy log files into logs directory
if: always()
run: cp ${GITHUB_WORKSPACE}/*.log ${RUNNER_WORKSPACE}/logs/

- name: Upload logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: logs_sonarqube
path: ${{ runner.workspace }}/logs
if-no-files-found: ignore
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Expand Up @@ -136,7 +136,7 @@ jobs:
- jobid: 'job1'
tests: 'ascii2nc'
- jobid: 'job2'
tests: 'pb2nc madis2nc pcp_combine'
tests: 'pb2nc madis2nc pcp_combine gen_ens_prod'
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
- jobid: 'job1'
tests: 'ascii2nc_indy pb2nc_indy tc_dland tc_pairs tc_stat plot_tc tc_rmw rmw_analysis tc_diag tc_gen'
- jobid: 'job2'
tests: 'met_test_scripts mode_multivar mode_graphics mtd regrid airnow gsi_tools netcdf modis series_analysis gen_ens_prod wwmca_regrid gen_vx_mask grid_weight interp_shape grid_diag grib_tables lidar2nc shift_data_plane trmm2nc aeronet wwmca_plot ioda2nc gaussian'
tests: 'met_test_scripts mode_multivar mode_graphics mtd regrid airnow gsi_tools netcdf modis series_analysis wwmca_regrid gen_vx_mask grid_weight interp_shape grid_diag grib_tables lidar2nc shift_data_plane trmm2nc aeronet wwmca_plot ioda2nc gaussian'
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 0 additions & 6 deletions data/config/GridStatConfig_default
Expand Up @@ -264,12 +264,6 @@ nc_pairs_flag = {

////////////////////////////////////////////////////////////////////////////////

ugrid_dataset = "";
ugrid_max_distance_km = 30;
ugrid_coordinates_file = "";

////////////////////////////////////////////////////////////////////////////////

grid_weight_flag = NONE;
tmp_dir = "/tmp";
output_prefix = "";
Expand Down
6 changes: 0 additions & 6 deletions data/config/PointStatConfig_default
Expand Up @@ -299,12 +299,6 @@ output_flag = {

////////////////////////////////////////////////////////////////////////////////

ugrid_dataset = "";
ugrid_max_distance_km = 30;
ugrid_coordinates_file = "";

////////////////////////////////////////////////////////////////////////////////

tmp_dir = "/tmp";
output_prefix = "";
version = "V12.0.0";
Expand Down
3 changes: 1 addition & 2 deletions data/config/TCRMWConfig_default
Expand Up @@ -98,9 +98,8 @@ regrid = {
//
n_range = 100;
n_azimuth = 180;
max_range_km = 1000.0;
delta_range_km = 10.0;
rmw_scale = 0.2;
rmw_scale = NA;

//
// Optionally convert u/v winds to tangential/radial winds
Expand Down
17 changes: 4 additions & 13 deletions data/config/UGridConfig_lfric
Expand Up @@ -2,7 +2,7 @@
//
// Unstructured grid configuration file.
//
// UGridConfig_lfric at the current working directory overrides the settings here.
// UGridConfig_lfric at the current working directory replaces the settings here.
// For additional or updated information, please see the MET User's Guide.
//
////////////////////////////////////////////////////////////////////////////////
Expand All @@ -12,23 +12,14 @@
//
ugrid_metadata_map = [
{ key = "dim_face"; val = "nMesh2d_face"; },
{ key = "dim_node"; val = "nMesh2d_node"; },
{ key = "dim_edge"; val = "nMesh2d_edge"; },
{ key = "dim_time"; val = "time_counter"; },
{ key = "dim_vert"; val = "nVertLevels"; },
{ key = "cell_id"; val = "indexToCellID"; },
{ key = "dim_vert"; val = ""; }, // optional
{ key = "lat_face"; val = "Mesh2d_face_y"; },
{ key = "lon_face"; val = "Mesh2d_face_x"; },
{ key = "vert_face"; val = "zCell"; },
{ key = "lat_edge"; val = "Mesh2d_edge_y"; },
{ key = "lon_edge"; val = "Mesh2d_edge_x"; },
{ key = "lat_node"; val = "Mesh2d_node_y"; },
{ key = "lon_node"; val = "Mesh2d_node_x"; },
{ key = "time"; val = "time_centered"; }
{ key = "vert_face"; val = ""; }, // optional
{ key = "time"; val = "time_instant"; }
];

ugrid_max_distance_km = 30;

////////////////////////////////////////////////////////////////////////////////

version = "V12.0.0";
Expand Down
15 changes: 3 additions & 12 deletions data/config/UGridConfig_mpas
Expand Up @@ -2,7 +2,7 @@
//
// Unstructured grid configuration file.
//
// UGridConfig_mpas at the current working directory overrides the settings here.
// UGridConfig_mpas at the current working directory replaces the settings here.
// For additional or updated information, please see the MET User's Guide.
//
////////////////////////////////////////////////////////////////////////////////
Expand All @@ -12,23 +12,14 @@
//
ugrid_metadata_map = [
{ key = "dim_face"; val = "nCells"; },
{ key = "dim_node"; val = "nVertices"; },
{ key = "dim_edge"; val = "nEdges"; },
{ key = "dim_time"; val = "Time"; },
{ key = "dim_vert"; val = "nVertLevels"; },
{ key = "cell_id"; val = "indexToCellID"; },
{ key = "dim_vert"; val = "nVertLevels"; }, // optional
{ key = "lat_face"; val = "latCell"; },
{ key = "lon_face"; val = "lonCell"; },
{ key = "vert_face"; val = "zCell"; },
{ key = "lat_edge"; val = "latEdge"; },
{ key = "lon_edge"; val = "lonEdge"; },
{ key = "lat_node"; val = "latVertex"; },
{ key = "lon_node"; val = "lonVertex"; },
{ key = "vert_face"; val = "zCell"; }, // optional
{ key = "time"; val = "xtime"; }
];

ugrid_max_distance_km = 30;

////////////////////////////////////////////////////////////////////////////////

version = "V12.0.0";
Expand Down
2 changes: 1 addition & 1 deletion data/table_files/met_header_columns_V12.0.txt
Expand Up @@ -19,7 +19,7 @@ V12.0 : STAT : PJC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID
V12.0 : STAT : PRC : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_THRESH) THRESH_[0-9]* PODY_[0-9]* POFD_[0-9]*
V12.0 : STAT : PSTD : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_THRESH) BASER BASER_NCL BASER_NCU RELIABILITY RESOLUTION UNCERTAINTY ROC_AUC BRIER BRIER_NCL BRIER_NCU BRIERCL BRIERCL_NCL BRIERCL_NCU BSS BSS_SMPL THRESH_[0-9]*
V12.0 : STAT : ECLV : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL BASER VALUE_BASER (N_PTS) CL_[0-9]* VALUE_[0-9]*
V12.0 : STAT : ECNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_ENS CRPS CRPSS IGN ME RMSE SPREAD ME_OERR RMSE_OERR SPREAD_OERR SPREAD_PLUS_OERR CRPSCL CRPS_EMP CRPSCL_EMP CRPSS_EMP CRPS_EMP_FAIR SPREAD_MD MAE MAE_OERR BIAS_RATIO N_GE_OBS ME_GE_OBS N_LT_OBS ME_LT_OBS
V12.0 : STAT : ECNT : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_ENS CRPS CRPSS IGN ME RMSE SPREAD ME_OERR RMSE_OERR SPREAD_OERR SPREAD_PLUS_OERR CRPSCL CRPS_EMP CRPSCL_EMP CRPSS_EMP CRPS_EMP_FAIR SPREAD_MD MAE MAE_OERR BIAS_RATIO N_GE_OBS ME_GE_OBS N_LT_OBS ME_LT_OBS IGN_CONV_OERR IGN_CORR_OERR
V12.0 : STAT : RPS : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL N_PROB RPS_REL RPS_RES RPS_UNC RPS RPSS RPSS_SMPL RPS_COMP
V12.0 : STAT : RHIST : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL (N_RANK) RANK_[0-9]*
V12.0 : STAT : PHIST : VERSION MODEL DESC FCST_LEAD FCST_VALID_BEG FCST_VALID_END OBS_LEAD OBS_VALID_BEG OBS_VALID_END FCST_VAR FCST_UNITS FCST_LEV OBS_VAR OBS_UNITS OBS_LEV OBTYPE VX_MASK INTERP_MTHD INTERP_PNTS FCST_THRESH OBS_THRESH COV_THRESH ALPHA LINE_TYPE TOTAL BIN_SIZE (N_BIN) BIN_[0-9]*
Expand Down

0 comments on commit 09bdbf6

Please sign in to comment.