GetUser() public method

public GetUser ( int id ) : NGitLab.Models.User
id int
return NGitLab.Models.User
Ejemplo n.º 1
0
        static void ProcessMergeRequestHook(GitLabWrapper gitLabWrapper, string serviceUser, MergeRequestHookClient hook, bool supportSendingMessages, string farmTaskName) {
            Log.Message($"Merge hook title: {hook.Attributes.Description}");
            Log.Message($"Merge hook state: {hook.Attributes.State}");

            var targetProject = gitLabWrapper.GetProject(hook.Attributes.TargetProjectId);
            var mergeRequest = gitLabWrapper.GetMergeRequest(targetProject, hook.Attributes.Id);
            if (supportSendingMessages)
                SendMessage(serviceUser, hook.Json, farmTaskName);

            if (!IsOpenedState(hook))
                return;

            Log.Message($"Merge hook action: {hook.Attributes.Action}");
            Log.Message($"Merge hook merge status: {hook.Attributes.MergeStatus}");
            Log.Message($"Merge hook author: {gitLabWrapper.GetUser(hook.Attributes.AuthorId).Name}.");
            Log.Message($"Merge hook target branch: {hook.Attributes.TargetBranch}.");
            Log.Message($"Merge hook sourceBranch branch: {hook.Attributes.SourceBranch}.");

            if (ShouldForceSyncTask(mergeRequest, hook)) {
                ForceSyncBuild(gitLabWrapper, mergeRequest, targetProject, hook);
                return;
            }
        }