Skip to content

Commit 427fb5f

Browse files
authored
Merge pull request #700 from NASA-PDS/issue_406
Add API support for checking if a search field exists in a result (e.g. not null)
2 parents 6c22863 + cd136b0 commit 427fb5f

16 files changed

Lines changed: 251 additions & 522 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [1.6.0](https://github.com/NASA-PDS/registry-api/tree/1.6.0) (2025-10-14)
44

5-
[Full Changelog](https://github.com/NASA-PDS/registry-api/compare/v1.6.2...1.6.0)
5+
[Full Changelog](https://github.com/NASA-PDS/registry-api/compare/1.6.0...v1.6.2)
66

77
**Defects:**
88

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,24 @@ There are a few steps required to prepare for merging code back into the main br
6363

6464
1. Create a pull request if have not done this already.
6565
1. Address all automated messages.
66-
1. Run all regression checks to make sure changes have re-introduced already fixed bugs.
66+
1. **Add required integration tests** (see [Integration Testing Requirements](#integration-testing-requirements) below).
67+
1. Run all regression checks to make sure changes have not re-introduced already fixed bugs.
6768
1. Move from draft to ready for review if in draft mode.
6869
1. Request review.
6970

71+
## Integration Testing Requirements
72+
73+
**IMPORTANT**: Each new feature, requirement, or bug fix must include at least one integration test added to the Postman collection.
74+
75+
Integration tests are maintained in the [`registry` repository](https://github.com/NASA-PDS/registry) and must be updated as part of your contribution. For detailed instructions on creating and submitting integration tests, see:
76+
77+
**[Integration Testing Guide](https://nasa-pds.github.io/registry/developer/integration-testing.html)**
78+
79+
The guide covers:
80+
- When tests are required
81+
- Step-by-step process for adding tests to Postman
82+
- TestRail integration (for internal developers)
83+
- Running and validating tests locally
84+
- Submitting test updates via pull request
85+
7086

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,19 @@ The integration tests will be automatically applied. Check the results, update/c
113113

114114
## Tests
115115

116-
**Important note:** As a developer you are asked to complete the postman test suite according to the new feature you are developing. Do a pull request in the `registry` project to submit the updates.
116+
### Testing Requirements
117117

118-
Integration test are maintained in postman.
118+
**IMPORTANT:** As a developer, you are **required** to add integration tests to the Postman test suite for:
119+
- Each new feature or requirement
120+
- Each bug fix
121+
- Any changes to existing API behavior
119122

120-
### Edit/Run of the integration tests in postman GUI
123+
### Integration Testing Guide
121124

122-
Install the postman desktop, from https://www.postman.com/downloads/
125+
Integration tests are maintained in the `registry` repository as Postman collections. For complete instructions on creating, running, and submitting integration tests, see:
123126

124-
Download and open the test suite found in https://github.com/NASA-PDS/registry/tree/main/docker/postman
127+
**[Integration Testing Guide](https://nasa-pds.github.io/registry/developer/integration-testing.html)**
125128

126-
### Run the integration tests in command line
127-
128-
In the `registry` project.
129-
130-
Launch the test in command line:
131-
132-
npm install newman
133-
newman run docker/postman/postman_collection.json --env-var baseUrl=http://localhost:8080
129+
All test updates must be submitted as pull requests to the [`registry` repository](https://github.com/NASA-PDS/registry).
134130

135131

docker/Dockerfile.local

Lines changed: 0 additions & 37 deletions
This file was deleted.

docker/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,3 @@ For example on AWS, with OpenSearch serverless as a back-end:
4646

4747
SPRING_BOOT_APP_ARGS=--openSearch.host=<your opensearch serverless URL> --openSearch.CCSEnabled=true --openSearch.username="" --openSearch.disciplineNodes=atm-delta,en-delta --registry.service.version=1.5.0-SNAPSHOT
4848
SERVER_PORT=80
49-
50-
51-
52-
53-
54-
55-
## 📍 Dockerfile.local
56-
57-
You can ignore `Dockerfile.local` unless you're @al-niessner.

lexer/src/main/antlr4/gov/nasa/pds/api/registry/lexer/Search.g4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
grammar Search;
22

33
query : queryTerm EOF ;
4-
queryTerm : comparison | likeComparison | group ;
4+
queryTerm : comparison | likeComparison | existence | group ;
55
group : NOT? LPAREN expression RPAREN ;
6+
existence : ( FIELD | STRINGVAL ) EXISTS ;
67
expression : andStatement | orStatement | queryTerm ;
78
andStatement : queryTerm (AND queryTerm)+ ;
89
orStatement : queryTerm (OR queryTerm)+ ;
@@ -19,6 +20,7 @@ GE : G E ;
1920
LT : L T ;
2021
LE : L E ;
2122

23+
EXISTS: E X I S T S;
2224
LIKE: L I K E;
2325

2426
LPAREN : '(' ;

lexer/src/test/java/api/pds/nasa/gov/api_search_query_lexer/MockedListener.java

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import gov.nasa.pds.api.registry.lexer.SearchParser.ExpressionContext;
1111
import gov.nasa.pds.api.registry.lexer.SearchParser.GroupContext;
1212
import gov.nasa.pds.api.registry.lexer.SearchParser.LikeComparisonContext;
13+
import gov.nasa.pds.api.registry.lexer.SearchParser.ExistenceContext;
1314
import gov.nasa.pds.api.registry.lexer.SearchParser.OperatorContext;
1415
import gov.nasa.pds.api.registry.lexer.SearchParser.OrStatementContext;
1516
import gov.nasa.pds.api.registry.lexer.SearchParser.QueryContext;
@@ -23,73 +24,73 @@ public class MockedListener implements ParseTreeListener, SearchListener {
2324

2425
@Override
2526
public void enterQuery(QueryContext ctx) {
26-
// TODO Auto-generated method stub
27+
// Nothing useful to do in this mocked version
2728

2829
}
2930

3031
@Override
3132
public void exitQuery(QueryContext ctx) {
32-
// TODO Auto-generated method stub
33+
// Nothing useful to do in this mocked version
3334

3435
}
3536

3637
@Override
3738
public void enterQueryTerm(QueryTermContext ctx) {
38-
// TODO Auto-generated method stub
39+
// Nothing useful to do in this mocked version
3940

4041
}
4142

4243
@Override
4344
public void exitQueryTerm(QueryTermContext ctx) {
44-
// TODO Auto-generated method stub
45+
// Nothing useful to do in this mocked version
4546

4647
}
4748

4849
@Override
4950
public void enterGroup(GroupContext ctx) {
50-
// TODO Auto-generated method stub
51+
// Nothing useful to do in this mocked version
5152

5253
}
5354

5455
@Override
5556
public void exitGroup(GroupContext ctx) {
56-
// TODO Auto-generated method stub
57+
// Nothing useful to do in this mocked version
5758

5859
}
5960

6061
@Override
6162
public void enterExpression(ExpressionContext ctx) {
62-
// TODO Auto-generated method stub
63+
// Nothing useful to do in this mocked version
6364

6465
}
6566

6667
@Override
6768
public void exitExpression(ExpressionContext ctx) {
68-
// TODO Auto-generated method stub
69+
// Nothing useful to do in this mocked version
6970

7071
}
7172

7273
@Override
7374
public void enterAndStatement(AndStatementContext ctx) {
74-
// TODO Auto-generated method stub
75+
// Nothing useful to do in this mocked version
7576

7677
}
7778

7879
@Override
7980
public void exitAndStatement(AndStatementContext ctx) {
80-
// TODO Auto-generated method stub
81+
// Nothing useful to do in this mocked version
8182

8283
}
8384

8485
@Override
8586
public void enterOrStatement(OrStatementContext ctx) {
86-
// TODO Auto-generated method stub
87+
// Nothing useful to do in this mocked version
8788

8889
}
8990

9091
@Override
9192
public void exitOrStatement(OrStatementContext ctx) {
92-
// TODO Auto-generated method stub
93+
// Nothing useful to do in this mocked version
9394

9495
}
9596

@@ -102,7 +103,7 @@ public void enterComparison(ComparisonContext ctx) {
102103

103104
@Override
104105
public void exitComparison(ComparisonContext ctx) {
105-
// TODO Auto-generated method stub
106+
// Nothing useful to do in this mocked version
106107

107108
}
108109

@@ -118,44 +119,57 @@ public void enterLikeComparison(LikeComparisonContext ctx) {
118119

119120
@Override
120121
public void exitLikeComparison(LikeComparisonContext ctx) {
121-
// TODO Auto-generated method stub
122+
// Nothing useful to do in this mocked version
122123

123124
}
124125

125126
@Override
126127
public void enterOperator(OperatorContext ctx) {
127-
// TODO Auto-generated method stub
128+
// Nothing useful to do in this mocked version
128129

129130
}
130131

131132
@Override
132133
public void exitOperator(OperatorContext ctx) {
133-
// TODO Auto-generated method stub
134+
// Nothing useful to do in this mocked version
134135

135136
}
136137

137138
@Override
138139
public void visitTerminal(TerminalNode node) {
139-
// TODO Auto-generated method stub
140+
// Nothing useful to do in this mocked version
140141

141142
}
142143

143144
@Override
144145
public void visitErrorNode(ErrorNode node) {
145-
// TODO Auto-generated method stub
146+
// Nothing useful to do in this mocked version
146147

147148
}
148149

149150
@Override
150151
public void enterEveryRule(ParserRuleContext ctx) {
151-
// TODO Auto-generated method stub
152+
// Nothing useful to do in this mocked version
152153

153154
}
154155

155156
@Override
156157
public void exitEveryRule(ParserRuleContext ctx) {
157-
// TODO Auto-generated method stub
158+
// Nothing useful to do in this mocked version
158159

159160
}
160161

162+
163+
@Override
164+
public void enterExistence(ExistenceContext ctx) {
165+
// Nothing useful to do in this mocked version
166+
167+
}
168+
169+
@Override
170+
public void exitExistence(ExistenceContext ctx) {
171+
this.field = ctx.FIELD();
172+
this.strval = ctx.STRINGVAL();
173+
}
174+
161175
}

0 commit comments

Comments
 (0)