Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: d41925407918544cf7b0785838b3361ac9c6900e
  • Loading branch information
Copybara authored and alexlaurinmath committed May 17, 2024
1 parent 2003a5e commit 2b85dbd
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 14 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Schema: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Verify Contribution Guidelines

on:
pull_request:
branches:
- main
types:
- opened
- reopened
- edited
- synchronize

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: >
Thank you for your interest in this project! At this moment, we are not currently accepting community contributions in the form of PRs.
If you would like to make a proposal,
we will do our best to review it, implement it ourselves, and include it in the next release.
If enough proposals come through, we will certainly revisit this policy to make the package as useful as possible.
[Contribution Guidelines](https://github.com/verily-src/fhirpath-go/CONTRIBUTING.md).
Thank you! 🙂
jobs:
pr-description:
name: Check PR Description
runs-on: ubuntu-latest
steps:
- name: Check PR description
id: check
env:
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
run: |
body="${PR_AUTHOR}"
body=$(echo "${body}" | sed -E -e '/OliverCardoza|bitwizeshift|VickSuresh|assefamaru|jonhayesverily|alexlaurinmath|Copybara/!d')
if [ -z "$body"]; then
echo "status=failure" >> "${GITHUB_OUTPUT}"
else
echo "status=success" >> "${GITHUB_OUTPUT}"
fi
# This stage is used to see whether we want to delete the comment once the
# problem has been resolved.
- name: Check for existing comment
id: comment
if: steps.check.outputs.status == 'failure'
continue-on-error: true
env:
PR_NUM: ${{ github.event.pull_request.number }}
run: |
# Check if comment already exists
comment_id=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"repos/verily-src/verily1/issues/${{ env.PR_NUM }}/comments" \
--jq ".[] | select(.body | contains(\"${{ env.MESSAGE }}\")) | .id")
echo "id=${comment_id}" >> "${GITHUB_OUTPUT}"
- name: Post comment
env:
PR_NUM: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
AUTHOR: "@${{ github.event.pull_request.user.login }}"
if: steps.check.outputs.status == 'failure' && steps.comment.outputs.id == ''
continue-on-error: true
run: |
gh pr comment "${{ env.PR_URL }}" -b "${{ env.AUTHOR }} ${{ env.MESSAGE }}"
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# How to contribute

## Reporting issues

Bugs, feature requests, and development-related questions should be directed to our GitHub issue tracker. If reporting a bug, please try and provide as much context as possible such as your operating system, Go version, and anything else that might be relevant to the bug. For feature requests, please explain what you're trying to do, and how the requested feature would help you do that.

## Pull Request

We don't currently accept pull requests from the public. They will be automatically closed. If you would like to make a proposal, we will do our best to review it, implement it ourselves, and include it in the next release. If enough proposals come through, we will certainly revisit this policy to make the package as useful as possible.
2 changes: 1 addition & 1 deletion internal/containedresource/contained_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
dtpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
bcrpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/resources/bundle_and_contained_resource_go_proto"
"github.com/google/fhir/go/proto/google/fhir/proto/r4/core/resources/patient_go_proto"
"github.com/verily-src/fhirpath-go/internal/containedresource"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/containedresource"
"github.com/verily-src/fhirpath-go/internal/fhirtest"
"github.com/verily-src/fhirpath-go/internal/resource"
"google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion internal/element/canonical/canonical_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
qpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/resources/questionnaire_go_proto"

"github.com/google/go-cmp/cmp"
"github.com/verily-src/fhirpath-go/internal/element/canonical"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/element/canonical"
"github.com/verily-src/fhirpath-go/internal/resource"
"google.golang.org/protobuf/testing/protocmp"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/element/extension/extension_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

dtpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
"github.com/google/fhir/go/proto/google/fhir/proto/r4/core/resources/task_go_proto"
"github.com/verily-src/fhirpath-go/internal/element/extension"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/element/extension"
)

func ExampleOverwrite() {
Expand Down
2 changes: 1 addition & 1 deletion internal/element/extension/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
dtpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/element/canonical"
"github.com/verily-src/fhirpath-go/internal/element/extension"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/fhirtest"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/testing/protocmp"
Expand Down
2 changes: 1 addition & 1 deletion internal/element/identifier/identifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/google/fhir/go/proto/google/fhir/proto/r4/core/codes_go_proto"
dtpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
"github.com/google/uuid"
"github.com/verily-src/fhirpath-go/internal/element/identifier"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/element/identifier"
"google.golang.org/protobuf/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/element/reference/reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
ppb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/resources/patient_go_proto"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/verily-src/fhirpath-go/internal/element/reference"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/element/reference"
"github.com/verily-src/fhirpath-go/internal/fhirtest"
"github.com/verily-src/fhirpath-go/internal/resource"
"google.golang.org/protobuf/testing/protocmp"
Expand Down
2 changes: 1 addition & 1 deletion internal/fhirtest/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
"github.com/verily-src/fhirpath-go/internal/fhir"
"github.com/verily-src/fhirpath-go/internal/protofields"
"github.com/verily-src/fhirpath-go/internal/resource"
"github.com/verily-src/fhirpath-go/internal/protofields"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
Expand Down
26 changes: 19 additions & 7 deletions internal/slices/slices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"
"testing"

dtpb "github.com/google/fhir/go/proto/google/fhir/proto/r4/core/datatypes_go_proto"
"github.com/google/go-cmp/cmp"
"github.com/verily-src/fhirpath-go/internal/slices"
"github.com/verily-src/fhirpath-go/internal/fhir"
"golang.org/x/exp/constraints"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
Expand Down Expand Up @@ -61,6 +61,24 @@ type stringTestCase[T any] struct {
expected string
}

var (
firstCoding = &dtpb.CodeableConcept{
Coding: []*dtpb.Coding{
{
System: &dtpb.Uri{Value: "test-system"},
Code: &dtpb.Code{Value: "1"},
},
},
}
secondCoding = &dtpb.CodeableConcept{
Coding: []*dtpb.Coding{
{
System: &dtpb.Uri{Value: "test-system"},
Code: &dtpb.Code{Value: "2"},
},
},
}
)
func TestIsIdentical(t *testing.T) {
type s1 []int
type s2 []int
Expand Down Expand Up @@ -257,8 +275,6 @@ func TestIncludes(t *testing.T) {
}

func TestIndexOf(t *testing.T) {
firstCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "1"))
secondCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "2"))
firstProto := proto.Message(firstCoding)
secondProto := proto.Message(secondCoding)
testCases := []indexTestCase[any]{
Expand Down Expand Up @@ -568,8 +584,6 @@ func TestIsUnique_SimpleType(t *testing.T) {
}

func TestIsUnique_Proto(t *testing.T) {
firstCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "1"))
secondCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "2"))
firstProto := proto.Message(firstCoding)
secondProto := proto.Message(secondCoding)

Expand Down Expand Up @@ -630,8 +644,6 @@ func TestUnique_SimpleType(t *testing.T) {
}

func TestUnique_Proto(t *testing.T) {
firstCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "1"))
secondCoding := fhir.CodeableConcept("", fhir.Coding("test-system", "2"))
firstProto := proto.Message(firstCoding)
secondProto := proto.Message(secondCoding)

Expand Down

0 comments on commit 2b85dbd

Please sign in to comment.