1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. getRepositoryFileDiff
Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi

oci.DevOps.getRepositoryFileDiff

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi

    This data source provides details about a specific Repository File Diff resource in Oracle Cloud Infrastructure Devops service.

    Gets the line-by-line difference between file on different commits.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRepositoryFileDiff = oci.DevOps.getRepositoryFileDiff({
        baseVersion: repositoryFileDiffBaseVersion,
        repositoryId: testRepository.id,
        targetVersion: repositoryFileDiffTargetVersion,
        filePath: repositoryFileDiffFilePath,
        isComparisonFromMergeBase: repositoryFileDiffIsComparisonFromMergeBase,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_repository_file_diff = oci.DevOps.get_repository_file_diff(base_version=repository_file_diff_base_version,
        repository_id=test_repository["id"],
        target_version=repository_file_diff_target_version,
        file_path=repository_file_diff_file_path,
        is_comparison_from_merge_base=repository_file_diff_is_comparison_from_merge_base)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/DevOps"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DevOps.GetRepositoryFileDiff(ctx, &devops.GetRepositoryFileDiffArgs{
    			BaseVersion:               repositoryFileDiffBaseVersion,
    			RepositoryId:              testRepository.Id,
    			TargetVersion:             repositoryFileDiffTargetVersion,
    			FilePath:                  repositoryFileDiffFilePath,
    			IsComparisonFromMergeBase: pulumi.BoolRef(repositoryFileDiffIsComparisonFromMergeBase),
    		}, 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 testRepositoryFileDiff = Oci.DevOps.GetRepositoryFileDiff.Invoke(new()
        {
            BaseVersion = repositoryFileDiffBaseVersion,
            RepositoryId = testRepository.Id,
            TargetVersion = repositoryFileDiffTargetVersion,
            FilePath = repositoryFileDiffFilePath,
            IsComparisonFromMergeBase = repositoryFileDiffIsComparisonFromMergeBase,
        });
    
    });
    
    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.GetRepositoryFileDiffArgs;
    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 testRepositoryFileDiff = DevOpsFunctions.getRepositoryFileDiff(GetRepositoryFileDiffArgs.builder()
                .baseVersion(repositoryFileDiffBaseVersion)
                .repositoryId(testRepository.id())
                .targetVersion(repositoryFileDiffTargetVersion)
                .filePath(repositoryFileDiffFilePath)
                .isComparisonFromMergeBase(repositoryFileDiffIsComparisonFromMergeBase)
                .build());
    
        }
    }
    
    variables:
      testRepositoryFileDiff:
        fn::invoke:
          Function: oci:DevOps:getRepositoryFileDiff
          Arguments:
            baseVersion: ${repositoryFileDiffBaseVersion}
            repositoryId: ${testRepository.id}
            targetVersion: ${repositoryFileDiffTargetVersion}
            filePath: ${repositoryFileDiffFilePath}
            isComparisonFromMergeBase: ${repositoryFileDiffIsComparisonFromMergeBase}
    

    Using getRepositoryFileDiff

    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 getRepositoryFileDiff(args: GetRepositoryFileDiffArgs, opts?: InvokeOptions): Promise<GetRepositoryFileDiffResult>
    function getRepositoryFileDiffOutput(args: GetRepositoryFileDiffOutputArgs, opts?: InvokeOptions): Output<GetRepositoryFileDiffResult>
    def get_repository_file_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) -> GetRepositoryFileDiffResult
    def get_repository_file_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[GetRepositoryFileDiffResult]
    func GetRepositoryFileDiff(ctx *Context, args *GetRepositoryFileDiffArgs, opts ...InvokeOption) (*GetRepositoryFileDiffResult, error)
    func GetRepositoryFileDiffOutput(ctx *Context, args *GetRepositoryFileDiffOutputArgs, opts ...InvokeOption) GetRepositoryFileDiffResultOutput

    > Note: This function is named GetRepositoryFileDiff in the Go SDK.

    public static class GetRepositoryFileDiff 
    {
        public static Task<GetRepositoryFileDiffResult> InvokeAsync(GetRepositoryFileDiffArgs args, InvokeOptions? opts = null)
        public static Output<GetRepositoryFileDiffResult> Invoke(GetRepositoryFileDiffInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRepositoryFileDiffResult> getRepositoryFileDiff(GetRepositoryFileDiffArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DevOps/getRepositoryFileDiff:getRepositoryFileDiff
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BaseVersion string
    The branch to compare changes against.
    FilePath string
    A filter to return only commits that affect any of the specified paths.
    RepositoryId string
    Unique repository identifier.
    TargetVersion string
    The branch where changes are coming from.
    IsComparisonFromMergeBase bool
    Boolean to indicate whether to use merge base or most recent revision.
    BaseVersion string
    The branch to compare changes against.
    FilePath string
    A filter to return only commits that affect any of the specified paths.
    RepositoryId string
    Unique repository identifier.
    TargetVersion string
    The branch where changes are coming from.
    IsComparisonFromMergeBase bool
    Boolean to indicate whether to use merge base or most recent revision.
    baseVersion String
    The branch to compare changes against.
    filePath String
    A filter to return only commits that affect any of the specified paths.
    repositoryId String
    Unique repository identifier.
    targetVersion String
    The branch where changes are coming from.
    isComparisonFromMergeBase Boolean
    Boolean to indicate whether to use merge base or most recent revision.
    baseVersion string
    The branch to compare changes against.
    filePath string
    A filter to return only commits that affect any of the specified paths.
    repositoryId string
    Unique repository identifier.
    targetVersion string
    The branch where changes are coming from.
    isComparisonFromMergeBase boolean
    Boolean to indicate whether to use merge base or most recent revision.
    base_version str
    The branch to compare changes against.
    file_path str
    A filter to return only commits that affect any of the specified paths.
    repository_id str
    Unique repository identifier.
    target_version str
    The branch where changes are coming from.
    is_comparison_from_merge_base bool
    Boolean to indicate whether to use merge base or most recent revision.
    baseVersion String
    The branch to compare changes against.
    filePath String
    A filter to return only commits that affect any of the specified paths.
    repositoryId String
    Unique repository identifier.
    targetVersion String
    The branch where changes are coming from.
    isComparisonFromMergeBase Boolean
    Boolean to indicate whether to use merge base or most recent revision.

    getRepositoryFileDiff Result

    The following output properties are available:

    AreConflictsInFile bool
    Indicates whether the changed file contains conflicts.
    BaseVersion string
    Changes List<GetRepositoryFileDiffChange>
    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
    IsComparisonFromMergeBase bool
    AreConflictsInFile bool
    Indicates whether the changed file contains conflicts.
    BaseVersion string
    Changes []GetRepositoryFileDiffChange
    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
    IsComparisonFromMergeBase bool
    areConflictsInFile Boolean
    Indicates whether the changed file contains conflicts.
    baseVersion String
    changes List<GetRepositoryFileDiffChange>
    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
    isComparisonFromMergeBase Boolean
    areConflictsInFile boolean
    Indicates whether the changed file contains conflicts.
    baseVersion string
    changes GetRepositoryFileDiffChange[]
    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
    isComparisonFromMergeBase boolean
    are_conflicts_in_file bool
    Indicates whether the changed file contains conflicts.
    base_version str
    changes Sequence[devops.GetRepositoryFileDiffChange]
    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_from_merge_base bool
    areConflictsInFile Boolean
    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
    isComparisonFromMergeBase Boolean

    Supporting Types

    GetRepositoryFileDiffChange

    BaseLine int
    The number of a line in the base version.
    BaseSpan int
    Number of lines chunk spans in base version.
    DiffSections List<GetRepositoryFileDiffChangeDiffSection>
    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 []GetRepositoryFileDiffChangeDiffSection
    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<GetRepositoryFileDiffChangeDiffSection>
    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 GetRepositoryFileDiffChangeDiffSection[]
    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[devops.GetRepositoryFileDiffChangeDiffSection]
    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.

    GetRepositoryFileDiffChangeDiffSection

    Lines List<GetRepositoryFileDiffChangeDiffSectionLine>
    The lines within changed section.
    Type string
    Type of change.
    Lines []GetRepositoryFileDiffChangeDiffSectionLine
    The lines within changed section.
    Type string
    Type of change.
    lines List<GetRepositoryFileDiffChangeDiffSectionLine>
    The lines within changed section.
    type String
    Type of change.
    lines GetRepositoryFileDiffChangeDiffSectionLine[]
    The lines within changed section.
    type string
    Type of change.
    lines Sequence[devops.GetRepositoryFileDiffChangeDiffSectionLine]
    The lines within changed section.
    type str
    Type of change.
    lines List<Property Map>
    The lines within changed section.
    type String
    Type of change.

    GetRepositoryFileDiffChangeDiffSectionLine

    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 oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.37.0 published on Friday, May 24, 2024 by Pulumi