Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions sdk/java/config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be run in CI?

Copy link
Author

@kjswaruph kjswaruph Aug 12, 2025

Choose a reason for hiding this comment

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

Thank you for the review , present configuration is only for local development it is not set for CI but i will make changes for CI.

<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="charset" value="UTF-8" />
<property name="severity" value="warning" />
<property name="fileExtensions" value="java, properties, xml" />

<module name="TreeWalker">

<module name="JavadocStyle">
<property name="checkFirstSentence" value="true"/>
<property name="checkEmptyJavadoc" value="true"/>
<property name="checkHtml" value="true"/>
</module>

<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="validateThrows" value="false"/>
</module>

<module name="JavadocTagContinuationIndentation">
<property name="offset" value="4"/>
</module>

<module name="AtclauseOrder"/>

<module name="JavadocContentLocation"/>

<module name="MissingJavadocPackage"/>
<module name="MissingJavadocMethod"/>
<module name="MissingJavadocType"/>

</module>

<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

</module>
17 changes: 17 additions & 0 deletions sdk/java/config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<suppress checks=".*" files="com/pulumi/bootstrap/internal/.*"/>
<suppress checks=".*" files="com/pulumi/codegen/internal/.*"/>
<suppress checks=".*" files="com/pulumi/context/internal/.*"/>
<suppress checks=".*" files="com/pulumi/core/internal/.*"/>
<suppress checks=".*" files="com/pulumi/deployment/internal/.*"/>
<suppress checks=".*" files="com/pulumi/internal/.*"/>
<suppress checks=".*" files="com/pulumi/resources/internal/.*"/>
<suppress checks=".*" files="com/pulumi/serialization/internal/.*"/>
</suppressions>

12 changes: 12 additions & 0 deletions sdk/java/pulumi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("java-library")
id("maven-publish")
id("com.google.protobuf") version "0.9.4"
id("checkstyle")
id("jacoco")
}

Expand Down Expand Up @@ -310,6 +311,17 @@ if (ossrhUsername) {
}
}

checkstyle {
toolVersion = "10.26.0"
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}


task exportKeyDependencies {
doLast {
Expand Down
6 changes: 6 additions & 0 deletions sdk/java/pulumi/src/main/java/codegen/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Contains auto-generated classes and interfaces including gRPC services and protocol buffer messages.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package codegen;
3 changes: 3 additions & 0 deletions sdk/java/pulumi/src/main/java/com/pulumi/asset/Archive.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ protected Archive(String propName, Object value) {
super(Constants.SpecialArchiveSig, propName, value);
}

/**
* An InvalidArchive is internal class for uninitialized or invalid {@link Archive}
*/
@InternalUse
public static final class InvalidArchive extends Archive {
public InvalidArchive() {
Expand Down
3 changes: 3 additions & 0 deletions sdk/java/pulumi/src/main/java/com/pulumi/asset/Asset.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ protected Asset(String propName, Object value) {
super(Constants.SpecialAssetSig, propName, value);
}

/**
* An InvalidAsset is an internal class for uninitialized or invalid {@link Asset}
*/
@InternalUse
public static final class InvalidAsset extends Asset {
public InvalidAsset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ protected AssetOrArchive(String sigKey, String propName, Object value) {
this.value = requireNonNull(value);
}

/**
* An AssetOrArchiveInternal is internal helper class of {@link AssetOrArchive}.
*/
public static final class AssetOrArchiveInternal {

private final AssetOrArchive assetOrArchive;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Provides types for working with assets and archives.
*/
package com.pulumi.asset;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal event implementation details for the Pulumi Automation API.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.automation.events.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Provides types describing Pulumi engine events, such as changes to resources or diagnostic messages, for use in the Pulumi Automation API.
*/

package com.pulumi.automation.events;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Provides the Pulumi Automation API, the programmatic interface for driving Pulumi programs, encapsulating the functionality of the CLI.
*/
package com.pulumi.automation;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

import com.pulumi.core.internal.annotations.InternalUse;

/**
* Annotation indicating that a boolean field should be skipped during serialization if its value is {@code false}.
*/
@InternalUse
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Provides internal serialization utilities and implementation details for Pulumi Automation API.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.automation.serialization.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal bootstrap utilities for plugin discovery and metadata management.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.bootstrap.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Contains internal utilities for code generation and serialization
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.codegen.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Provides internal context implementation classes.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.context.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Provides context interfaces for managing Pulumi program execution context,
* including configuration, logging, and runtime information.
*/
package com.pulumi.context;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotation to specify the Pulumi resource type and version for a resource class.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ResourceType {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Provides annotations for resource and type metadata.
* <p>
* This package contains Java annotations for marking resources,
* configuring metadata, and providing type information for Pulumi resources.
*/
package com.pulumi.core.annotations;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Contains internal annotations and metadata utilities.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.core.internal.annotations;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal utilities and classes for core functionality.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.core.internal;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* Provides core types and utility classes.
*/
package com.pulumi.core;
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public Optional<String> getVersion() {
return Optional.ofNullable(version);
}

/**
* Internal helper class for resolving the effective {@link ProviderResource} and {@link Resource}
* options
*/
@InternalUse
public static final class CallOptionsInternal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;

/**
* Provides the deployment context and core operations.
*/
@InternalUse
public interface Deployment extends ReadOrRegisterResource, RegisterResourceOutputs {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
import com.pulumi.core.internal.annotations.InternalUse;
import com.pulumi.deployment.internal.DeploymentImpl;

/**
* An instance of a Pulumi deployment, providing access to deployment configuration,
* validity state, and lifecycle management for asynchronous operations.
*
* @see Deployment
* @see com.pulumi.deployment.internal.DeploymentImpl
*/
public interface DeploymentInstance extends Deployment {
@InternalUse
DeploymentImpl.Config getConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public static Builder builder() {
return new Builder();
}

/**
* The {@link InvokeOptions} builder.
*/
public static final class Builder {
private @Nullable Resource parent;
private @Nullable ProviderResource provider;
Expand Down Expand Up @@ -137,20 +140,49 @@ public InvokeOptions build() {
}
}

/**
* Internal utility class for advanced provider resolution logic within {@link InvokeOptions}.
*
* @see InvokeOptions
*/
@InternalUse
@ParametersAreNonnullByDefault
public static final class InvokeOptionsInternal {

/**
* The underlying {@link InvokeOptions} instance from which provider and parent information is resolved.
*/
private final InvokeOptions options;

/**
* Creates a new {@code InvokeOptionsInternal} wrapper for the given {@link InvokeOptions}.
*
* @param options the {@link InvokeOptions} instance to wrap; must not be null
* @throws NullPointerException if {@code options} is null
*/
private InvokeOptionsInternal(InvokeOptions options) {
this.options = requireNonNull(options);
}

/**
* Creates a new {@code InvokeOptionsInternal} from the specified {@link InvokeOptions}.
*
* @param options the {@link InvokeOptions} to wrap
* @return a new {@code InvokeOptionsInternal} instance
* @throws NullPointerException if {@code options} is null
*/
public static InvokeOptionsInternal from(InvokeOptions options) {
return new InvokeOptionsInternal(options);
}

/**
* Attempts to resolve a {@link ProviderResource} for the given provider token.
*
* @param token the provider token to resolve
* @return an {@link Optional} containing the resolved {@link ProviderResource}, or empty if not found
*
* @see ProviderResource
*/
public Optional<ProviderResource> getNestedProvider(String token) {
return this.options.getProvider().or(
() -> this.options.getParent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public List<Resource> getDependsOn() {
return this.dependsOn == null ? List.of() : new ArrayList<>(this.dependsOn);
}

/**
* The {@link InvokeOutputOptions} builder.
*/
public static final class Builder {
private @Nullable Resource parent;
private @Nullable ProviderResource provider;
Expand Down Expand Up @@ -117,20 +120,52 @@ public InvokeOutputOptions build() {
}
}

/**
* Internal utility class of {@link InvokeOutputOptions}.
*
* @see InvokeOutputOptions
* @see ProviderResource
* @see com.pulumi.core.internal.Internal
*/
@InternalUse
@ParametersAreNonnullByDefault
public static final class InvokeOutputOptionsInternal {

/**
* The underlying {@link InvokeOutputOptions} instance from which provider and parent information is resolved.
*/
private final InvokeOutputOptions options;

/**
* Creates a new {@code InvokeOutputOptionsInternal} wrapper for the given {@link InvokeOutputOptions}.
*
* @param options the {@link InvokeOutputOptions} instance to wrap; must not be null
* @throws NullPointerException if {@code options} is null
*/
private InvokeOutputOptionsInternal(InvokeOutputOptions options) {
this.options = requireNonNull(options);
}

/**
* Creates a new {@code InvokeOutputOptionsInternal} from the specified {@link InvokeOutputOptions}.
*
* @param options the {@link InvokeOutputOptions} to wrap
* @return a new {@code InvokeOutputOptionsInternal} instance
* @throws NullPointerException if {@code options} is null
*/
public static InvokeOutputOptionsInternal from(InvokeOutputOptions options) {
return new InvokeOutputOptionsInternal(options);
}

/**
* Attempts to resolve a {@link ProviderResource} for the given provider token.
*
* @param token the provider token to resolve
* @return an {@link Optional} containing the resolved {@link ProviderResource}, or empty if not found
*
* @see ProviderResource
* @see com.pulumi.core.internal.Internal#from(Resource)
*/
public Optional<ProviderResource> getNestedProvider(String token) {
return this.options.getProvider().or(
() -> this.options.getParent()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Provides internal deployment implementation for Pulumi stack deployment and resource management.
* <p>
* <b>Note:</b> This package is primarily for internal use and is not intended for direct use by end users.
*/
package com.pulumi.deployment.internal;
Loading