oci.DevOps.getRepositoryDiff
Explore with Pulumi AI
This data source provides details about a specific Repository Diff resource in Oracle Cloud Infrastructure Devops service.
Gets the line-by-line difference between file on different commits. This API will be deprecated on Wed, 29 Mar 2023 01:00:00 GMT as it does not get recognized when filePath has ‘/’. This will be replaced by “/repositories/{repositoryId}/file/diffs”
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testRepositoryDiff = oci.DevOps.getRepositoryDiff({
    baseVersion: repositoryDiffBaseVersion,
    filePath: repositoryDiffFilePath,
    repositoryId: testRepository.id,
    targetVersion: repositoryDiffTargetVersion,
    isComparisonFromMergeBase: repositoryDiffIsComparisonFromMergeBase,
});
import pulumi
import pulumi_oci as oci
test_repository_diff = oci.DevOps.get_repository_diff(base_version=repository_diff_base_version,
    file_path=repository_diff_file_path,
    repository_id=test_repository["id"],
    target_version=repository_diff_target_version,
    is_comparison_from_merge_base=repository_diff_is_comparison_from_merge_base)
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/devops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := devops.GetRepositoryDiff(ctx, &devops.GetRepositoryDiffArgs{
			BaseVersion:               repositoryDiffBaseVersion,
			FilePath:                  repositoryDiffFilePath,
			RepositoryId:              testRepository.Id,
			TargetVersion:             repositoryDiffTargetVersion,
			IsComparisonFromMergeBase: pulumi.BoolRef(repositoryDiffIsComparisonFromMergeBase),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testRepositoryDiff = Oci.DevOps.GetRepositoryDiff.Invoke(new()
    {
        BaseVersion = repositoryDiffBaseVersion,
        FilePath = repositoryDiffFilePath,
        RepositoryId = testRepository.Id,
        TargetVersion = repositoryDiffTargetVersion,
        IsComparisonFromMergeBase = repositoryDiffIsComparisonFromMergeBase,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DevOps.DevOpsFunctions;
import com.pulumi.oci.DevOps.inputs.GetRepositoryDiffArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testRepositoryDiff = DevOpsFunctions.getRepositoryDiff(GetRepositoryDiffArgs.builder()
            .baseVersion(repositoryDiffBaseVersion)
            .filePath(repositoryDiffFilePath)
            .repositoryId(testRepository.id())
            .targetVersion(repositoryDiffTargetVersion)
            .isComparisonFromMergeBase(repositoryDiffIsComparisonFromMergeBase)
            .build());
    }
}
variables:
  testRepositoryDiff:
    fn::invoke:
      function: oci:DevOps:getRepositoryDiff
      arguments:
        baseVersion: ${repositoryDiffBaseVersion}
        filePath: ${repositoryDiffFilePath}
        repositoryId: ${testRepository.id}
        targetVersion: ${repositoryDiffTargetVersion}
        isComparisonFromMergeBase: ${repositoryDiffIsComparisonFromMergeBase}
Using getRepositoryDiff
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRepositoryDiff(args: GetRepositoryDiffArgs, opts?: InvokeOptions): Promise<GetRepositoryDiffResult>
function getRepositoryDiffOutput(args: GetRepositoryDiffOutputArgs, opts?: InvokeOptions): Output<GetRepositoryDiffResult>def get_repository_diff(base_version: Optional[str] = None,
                        file_path: Optional[str] = None,
                        is_comparison_from_merge_base: Optional[bool] = None,
                        repository_id: Optional[str] = None,
                        target_version: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRepositoryDiffResult
def get_repository_diff_output(base_version: Optional[pulumi.Input[str]] = None,
                        file_path: Optional[pulumi.Input[str]] = None,
                        is_comparison_from_merge_base: Optional[pulumi.Input[bool]] = None,
                        repository_id: Optional[pulumi.Input[str]] = None,
                        target_version: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryDiffResult]func GetRepositoryDiff(ctx *Context, args *GetRepositoryDiffArgs, opts ...InvokeOption) (*GetRepositoryDiffResult, error)
func GetRepositoryDiffOutput(ctx *Context, args *GetRepositoryDiffOutputArgs, opts ...InvokeOption) GetRepositoryDiffResultOutput> Note: This function is named GetRepositoryDiff in the Go SDK.
public static class GetRepositoryDiff 
{
    public static Task<GetRepositoryDiffResult> InvokeAsync(GetRepositoryDiffArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryDiffResult> Invoke(GetRepositoryDiffInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRepositoryDiffResult> getRepositoryDiff(GetRepositoryDiffArgs args, InvokeOptions options)
public static Output<GetRepositoryDiffResult> getRepositoryDiff(GetRepositoryDiffArgs args, InvokeOptions options)
fn::invoke:
  function: oci:DevOps/getRepositoryDiff:getRepositoryDiff
  arguments:
    # arguments dictionaryThe following arguments are supported:
- BaseVersion string
- The branch to compare changes against.
- FilePath string
- Path to a file within a repository.
- RepositoryId string
- Unique repository identifier.
- TargetVersion string
- The branch where changes are coming from.
- IsComparison boolFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- BaseVersion string
- The branch to compare changes against.
- FilePath string
- Path to a file within a repository.
- RepositoryId string
- Unique repository identifier.
- TargetVersion string
- The branch where changes are coming from.
- IsComparison boolFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion String
- The branch to compare changes against.
- filePath String
- Path to a file within a repository.
- repositoryId String
- Unique repository identifier.
- targetVersion String
- The branch where changes are coming from.
- isComparison BooleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion string
- The branch to compare changes against.
- filePath string
- Path to a file within a repository.
- repositoryId string
- Unique repository identifier.
- targetVersion string
- The branch where changes are coming from.
- isComparison booleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
- base_version str
- The branch to compare changes against.
- file_path str
- Path to a file within a repository.
- repository_id str
- Unique repository identifier.
- target_version str
- The branch where changes are coming from.
- is_comparison_ boolfrom_ merge_ base 
- Boolean to indicate whether to use merge base or most recent revision.
- baseVersion String
- The branch to compare changes against.
- filePath String
- Path to a file within a repository.
- repositoryId String
- Unique repository identifier.
- targetVersion String
- The branch where changes are coming from.
- isComparison BooleanFrom Merge Base 
- Boolean to indicate whether to use merge base or most recent revision.
getRepositoryDiff Result
The following output properties are available:
- AreConflicts boolIn File 
- Indicates whether the changed file contains conflicts.
- BaseVersion string
- Changes
List<GetRepository Diff Change> 
- List of changed section in the file.
- FilePath string
- Id string
- The provider-assigned unique ID for this managed resource.
- IsBinary bool
- Indicates whether the file is binary.
- IsLarge bool
- Indicates whether the file is large.
- NewId string
- The ID of the changed object on the target version.
- NewPath string
- The path on the target version to the changed object.
- OldId string
- The ID of the changed object on the base version.
- OldPath string
- The path on the base version to the changed object.
- RepositoryId string
- TargetVersion string
- IsComparison boolFrom Merge Base 
- AreConflicts boolIn File 
- Indicates whether the changed file contains conflicts.
- BaseVersion string
- Changes
[]GetRepository Diff Change 
- List of changed section in the file.
- FilePath string
- Id string
- The provider-assigned unique ID for this managed resource.
- IsBinary bool
- Indicates whether the file is binary.
- IsLarge bool
- Indicates whether the file is large.
- NewId string
- The ID of the changed object on the target version.
- NewPath string
- The path on the target version to the changed object.
- OldId string
- The ID of the changed object on the base version.
- OldPath string
- The path on the base version to the changed object.
- RepositoryId string
- TargetVersion string
- IsComparison boolFrom Merge Base 
- areConflicts BooleanIn File 
- Indicates whether the changed file contains conflicts.
- baseVersion String
- changes
List<GetRepository Diff Change> 
- List of changed section in the file.
- filePath String
- id String
- The provider-assigned unique ID for this managed resource.
- isBinary Boolean
- Indicates whether the file is binary.
- isLarge Boolean
- Indicates whether the file is large.
- newId String
- The ID of the changed object on the target version.
- newPath String
- The path on the target version to the changed object.
- oldId String
- The ID of the changed object on the base version.
- oldPath String
- The path on the base version to the changed object.
- repositoryId String
- targetVersion String
- isComparison BooleanFrom Merge Base 
- areConflicts booleanIn File 
- Indicates whether the changed file contains conflicts.
- baseVersion string
- changes
GetRepository Diff Change[] 
- List of changed section in the file.
- filePath string
- id string
- The provider-assigned unique ID for this managed resource.
- isBinary boolean
- Indicates whether the file is binary.
- isLarge boolean
- Indicates whether the file is large.
- newId string
- The ID of the changed object on the target version.
- newPath string
- The path on the target version to the changed object.
- oldId string
- The ID of the changed object on the base version.
- oldPath string
- The path on the base version to the changed object.
- repositoryId string
- targetVersion string
- isComparison booleanFrom Merge Base 
- are_conflicts_ boolin_ file 
- Indicates whether the changed file contains conflicts.
- base_version str
- changes
Sequence[GetRepository Diff Change] 
- List of changed section in the file.
- file_path str
- id str
- The provider-assigned unique ID for this managed resource.
- is_binary bool
- Indicates whether the file is binary.
- is_large bool
- Indicates whether the file is large.
- new_id str
- The ID of the changed object on the target version.
- new_path str
- The path on the target version to the changed object.
- old_id str
- The ID of the changed object on the base version.
- old_path str
- The path on the base version to the changed object.
- repository_id str
- target_version str
- is_comparison_ boolfrom_ merge_ base 
- areConflicts BooleanIn File 
- Indicates whether the changed file contains conflicts.
- baseVersion String
- changes List<Property Map>
- List of changed section in the file.
- filePath String
- id String
- The provider-assigned unique ID for this managed resource.
- isBinary Boolean
- Indicates whether the file is binary.
- isLarge Boolean
- Indicates whether the file is large.
- newId String
- The ID of the changed object on the target version.
- newPath String
- The path on the target version to the changed object.
- oldId String
- The ID of the changed object on the base version.
- oldPath String
- The path on the base version to the changed object.
- repositoryId String
- targetVersion String
- isComparison BooleanFrom Merge Base 
Supporting Types
GetRepositoryDiffChange   
- BaseLine int
- The number of a line in the base version.
- BaseSpan int
- Number of lines chunk spans in base version.
- DiffSections List<GetRepository Diff Change Diff Section> 
- List of difference section.
- TargetLine int
- Line number in target version where changes begin.
- TargetSpan int
- Number of lines chunk spans in target version.
- BaseLine int
- The number of a line in the base version.
- BaseSpan int
- Number of lines chunk spans in base version.
- DiffSections []GetRepository Diff Change Diff Section 
- List of difference section.
- TargetLine int
- Line number in target version where changes begin.
- TargetSpan int
- Number of lines chunk spans in target version.
- baseLine Integer
- The number of a line in the base version.
- baseSpan Integer
- Number of lines chunk spans in base version.
- diffSections List<GetRepository Diff Change Diff Section> 
- List of difference section.
- targetLine Integer
- Line number in target version where changes begin.
- targetSpan Integer
- Number of lines chunk spans in target version.
- baseLine number
- The number of a line in the base version.
- baseSpan number
- Number of lines chunk spans in base version.
- diffSections GetRepository Diff Change Diff Section[] 
- List of difference section.
- targetLine number
- Line number in target version where changes begin.
- targetSpan number
- Number of lines chunk spans in target version.
- base_line int
- The number of a line in the base version.
- base_span int
- Number of lines chunk spans in base version.
- diff_sections Sequence[GetRepository Diff Change Diff Section] 
- List of difference section.
- target_line int
- Line number in target version where changes begin.
- target_span int
- Number of lines chunk spans in target version.
- baseLine Number
- The number of a line in the base version.
- baseSpan Number
- Number of lines chunk spans in base version.
- diffSections List<Property Map>
- List of difference section.
- targetLine Number
- Line number in target version where changes begin.
- targetSpan Number
- Number of lines chunk spans in target version.
GetRepositoryDiffChangeDiffSection     
- Lines
List<GetRepository Diff Change Diff Section Line> 
- The lines within changed section.
- Type string
- Type of change.
- Lines
[]GetRepository Diff Change Diff Section Line 
- The lines within changed section.
- Type string
- Type of change.
- lines
List<GetRepository Diff Change Diff Section Line> 
- The lines within changed section.
- type String
- Type of change.
- lines
GetRepository Diff Change Diff Section Line[] 
- The lines within changed section.
- type string
- Type of change.
- lines
Sequence[GetRepository Diff Change Diff Section Line] 
- The lines within changed section.
- type str
- Type of change.
- lines List<Property Map>
- The lines within changed section.
- type String
- Type of change.
GetRepositoryDiffChangeDiffSectionLine      
- BaseLine int
- The number of a line in the base version.
- ConflictMarker string
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- LineContent string
- The contents of a line.
- TargetLine int
- Line number in target version where changes begin.
- BaseLine int
- The number of a line in the base version.
- ConflictMarker string
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- LineContent string
- The contents of a line.
- TargetLine int
- Line number in target version where changes begin.
- baseLine Integer
- The number of a line in the base version.
- conflictMarker String
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- lineContent String
- The contents of a line.
- targetLine Integer
- Line number in target version where changes begin.
- baseLine number
- The number of a line in the base version.
- conflictMarker string
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- lineContent string
- The contents of a line.
- targetLine number
- Line number in target version where changes begin.
- base_line int
- The number of a line in the base version.
- conflict_marker str
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- line_content str
- The contents of a line.
- target_line int
- Line number in target version where changes begin.
- baseLine Number
- The number of a line in the base version.
- conflictMarker String
- Indicates whether a line in a conflicted section of the difference is from the base version, the target version, or if its just a marker indicating the beginning, middle, or end of a conflicted section.
- lineContent String
- The contents of a line.
- targetLine Number
- Line number in target version where changes begin.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.