Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@exceptionfactory
Copy link
Contributor

Summary

NIFI-15292 Refactors state serialization in the GetAsanaObject Processor using simplified String and MapString implementations with Google Gson.

The refactored implementation replaces the generic Serializer and Deserializer implementation, built on Java Object serialization.

New unit tests exercise the streamlined implementations, and existing unit tests verify expected state handling behavior in the GetAsanaObject Processor.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Replaced generic Java Object serialization with simplified String and Map serialization using Gson
@takraj
Copy link
Contributor

takraj commented Dec 4, 2025

@exceptionfactory Thank you for submitting this change. In overall looks good, but I'll get more into the details and review it later today.

@pvillard31
Copy link
Contributor

@takraj - thanks for reviewing, I'll wait for your feedback.

As a side note, the current dependency usage makes me think we should deprecate this bundle. It is currently using the Asana client 1.0.0 (https://github.com/exceptionfactory/nifi/blob/main/nifi-extension-bundles/nifi-asana-bundle/pom.xml#L48) which is here https://github.com/Asana/java-asana. It is no longer maintained and the recommendation is: "We recommend using Java's HttpClient or similar HTTP libraries to make direct API requests instead."

This bundle currently brings a lot of very old dependencies (grpc 1.59, google http client 1.47, etc). So unless someone is willing to do the work, I think we should mark it as deprecated for removal in the future. I don't think the effort is huge but as always it's a matter of finding someone :)

@takraj
Copy link
Contributor

takraj commented Dec 4, 2025

@exceptionfactory

implementation replaces the generic Serializer and Deserializer implementation, built on Java Object serialization.

Did you test, what happens after upgrading to the new format? I can't see any migration logic. Will the state be simply lost, or will it cause the processor to crash until the user clears the state?

@takraj
Copy link
Contributor

takraj commented Dec 4, 2025

@pvillard31

As I see there is an OpenAPI spec for Asana, so a new client could be simply generated from it:
https://github.com/Asana/openapi

I can't tell however, how much work is it to adapt the differences if there are any. The original client was also generated from OpenAPI, but they have made a pre-built version available on maven too.

I would suggest to create a NIFI ticket to migrate this component to a new, generated client.

@exceptionfactory
Copy link
Contributor Author

@exceptionfactory

implementation replaces the generic Serializer and Deserializer implementation, built on Java Object serialization.

Did you test, what happens after upgrading to the new format? I can't see any migration logic. Will the state be simply lost, or will it cause the processor to crash until the user clears the state?

Yes, changing the format does result in exceptions on upgrade when there is existing state. This will require manual clearing of stored state in the associated cache server.

@exceptionfactory
Copy link
Contributor Author

@pvillard31

As I see there is an OpenAPI spec for Asana, so a new client could be simply generated from it: https://github.com/Asana/openapi

I can't tell however, how much work is it to adapt the differences if there are any. The original client was also generated from OpenAPI, but they have made a pre-built version available on maven too.

I would suggest to create a NIFI ticket to migrate this component to a new, generated client.

@takraj Is this something you are planning to work on soon? If not, then I agree with Pierre's suggestion that the current Processor should be marked as deprecated for removal.

Deprecating for removal could also provide the opportunity for a new future implementation if needed. Published NAR bundles of the current version could continue to be used, without maintaining the source code, if maintenance cycles are not available to work through the upgrade and redesign needed.

@exceptionfactory
Copy link
Contributor Author

@takraj and @pvillard31, I submitted PR #10601 to deprecate the current GetAsanaObject Processor and supporting Controller Service for removal. That should provide a path forward, just leaving this current issue as a minimal change to eliminate Java Object serialization.

Copy link
Contributor

@pvillard31 pvillard31 left a comment

Choose a reason for hiding this comment

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

Thanks @exceptionfactory - I'm a +1 with the current change as long as we add a note in the migration guide / release notes that clearing the state will be required. We then have the option or not to improve things to avoid the removal. I'll also +1 the addition of the deprecation notice.

@takraj - let me know your thoughts

@exceptionfactory
Copy link
Contributor Author

Thanks @pvillard31, I updated the Migration Guidance for 2.7.0 to mention the state change and deprecation for GetAsanaObject.

@takraj
Copy link
Contributor

takraj commented Dec 4, 2025

@pvillard31 +1 from my side as well.

@exceptionfactory
Copy link
Contributor Author

Thanks for the reviews @takraj and @pvillard31!

@pvillard31 pvillard31 closed this in 1c081c1 Dec 4, 2025
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.

3 participants