Skip to content

Conversation

@MFormenti
Copy link

Implement changes for the new webapp in TLS-Scanner-WS

ic0ns and others added 17 commits May 20, 2025 14:21
- Changed version from 1.2.1-SNAPSHOT-webapp to 1.2.1-SNAPSHOT
- Added dependencyManagement section to lock scanner-core at 6.2.2
- Removed explicit version from scanner-core dependency

This allows Jenkins CI to find artifacts in Nexus while maintaining version consistency locally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ix deserialization issues

Version:
- Moving Scanner-Core dependency from scanner-core 5.5.0 to 6.2.3

Fixes:
1. Add Jackson deserialization support to ScanResult
   - Add @JsonCreator annotation to private constructor
   - Add @JsonProperty annotations for all constructor parameters
   - Map 'resultStatus' JSON field to 'jobStatus' Java field
   - Fixes MongoDB deserialization via MongoJack

2. Fix Javadoc compilation error in IPersistenceProvider
   - Remove @param limit documentation for non-existent parameter

3. Implement missing methods in DummyPersistenceProvider
   - Add getScanResultsByTarget() returning empty list
   - Add getScanResultById() returning null
   - Fixes test compilation after interface updates
…l_results

# Conflicts:
#	pom.xml
#	src/main/java/de/rub/nds/crawler/core/BulkScanWorker.java
#	src/main/java/de/rub/nds/crawler/data/ScanJobDescription.java
#	src/main/java/de/rub/nds/crawler/data/ScanResult.java
#	src/test/java/de/rub/nds/crawler/dummy/DummyPersistenceProvider.java
# Conflicts:
#	src/main/java/de/rub/nds/crawler/core/BulkScanWorker.java
# Conflicts:
#	src/main/java/de/rub/nds/crawler/core/BulkScanWorker.java
@XoMEX XoMEX requested a review from Copilot October 28, 2025 11:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements changes to support a new webapp for TLS-Scanner-WS, adding improved error handling, documentation, and retrieval capabilities for scan results. The main changes focus on enhancing data persistence, improving code documentation, and updating dependencies.

Key changes:

  • Added new methods to retrieve scan results by target and ID from the persistence layer
  • Enhanced Jackson deserialization configuration to handle missing/unknown properties
  • Added comprehensive Javadoc documentation across multiple classes and interfaces
  • Updated scanner-core dependency from 5.5.0 to 6.2.3

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
MongoPersistenceProvider.java Implemented getScanResultsByTarget and getScanResultById methods, configured Jackson mapper for flexible deserialization, and added logging
IPersistenceProvider.java Added interface methods for retrieving scan results by target and ID
DummyPersistenceProvider.java Implemented stub methods for the new persistence interface methods
ScanResult.java Added JsonCreator annotation and default constructor for Jackson deserialization
ScanJobDescription.java Added UUID field for unique scan job identification
CancellableFuture.java Added comprehensive Javadoc and renamed parameters for clarity
CanceallableThreadPoolExecutor.java Added comprehensive Javadoc documentation
Multiple data/config classes Added Javadoc documentation for classes, methods, and fields
pom.xml Updated scanner-core dependency version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@XoMEX XoMEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstrings are often mediocre (I've pushed improvements).
Setting the result ID when writing to the DB is odd and should be avoided.
Some minor comments (also check copilot review)


public class ScanJobDescription implements Serializable {

private final UUID id = UUID.randomUUID();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this UUID used for? The BulkScan already has an ID.

this.result = result;
}

public ScanResult() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC jackson constructors can be private (and in this case should be, as no one else should call this constructor)

throw new IllegalArgumentException(
"ScanResult status does not match ScanJobDescription status");
}
scanResult.setId(scanJobDescription.getId().toString()); // <- Add this line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems super odd to set the id here. IMO the ID should be final (which I do not know why it isn't yet) and set in the constructor.


@Override
public List<ScanResult> getScanResultsByTarget(
String dbName, String collectionName, String target) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the ScanTarget class here?

Comment on lines +134 to +136
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES, false);
mapper.configure(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES, false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this set? This feels like treating the symptoms of failing deserialization rather than fixing why deserialization fails.

MFormenti and others added 2 commits October 29, 2025 14:58
…rovider.java


fixed typo error

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rovider.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MFormenti MFormenti closed this Nov 4, 2025
XoMEX added a commit that referenced this pull request Nov 4, 2025
Based on #61
XoMEX added a commit that referenced this pull request Nov 4, 2025
Based on #61
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

Successfully merging this pull request may close these issues.

5 participants