Question 380
A developer wants to see changes affecting a specific deployment manifest while excluding unrelated repository history. Which command family should be used?
- Rotate exposed credentials immediately
- Use git reflog to recover a lost local tip
- Restore one tracked file from a previous commit
- Use git log with path filtering
Explanation
Correct Answer
D:git log with a pathspec filters commit history to changes touching selected paths. Supply the manifest pathspec to narrow the commit list and review changes to that file without unrelated commits.
Incorrect Answers
A:Credential revocation or rotation invalidates a secret that may already have been copied; history rewriting alone cannot restore secrecy; it handles containment of leaked authentication material but cannot by itself deliver file-scoped commit history.
B:git reflog records local reference updates, often exposing prior commit hashes that can be restored before garbage collection; file-scoped commit history remains outside the responsibility of local reference move recovery.
C:git restore with a chosen source revision retrieves a file's content from the specified tree into the worktree or index; that acts on recovering selected file contents, whereas the requested outcome is file-scoped commit history.
Question 381
Two independent applications need a common client library but cannot coordinate every source commit or release together. Which reuse mechanism is preferable?
- Use sparse checkout in a large monorepo
- Use repository path-based ownership
- Use git-fat with an explicitly supported backend
- Share code through versioned packages
Explanation
Correct Answer
D:Publishing a versioned package gives each consumer an explicit dependency contract without forcing shared repository history.
Incorrect Answers
A:Sparse checkout limits the working-tree paths populated for a clone while retaining repository history semantics; the distinction is selective local working tree population versus decoupled code-sharing release cadence.
B:CODEOWNERS maps repository path patterns to responsible reviewers and aids targeted review governance; decoupled code-sharing release cadence cannot be delivered through ownership within one large repository.
C:git-fat tracks lightweight references in Git while synchronizing actual binary assets to an external storage backend; its effect is alternative external binary asset management, not decoupled code-sharing release cadence.
Question 382
An enterprise desktop application must reach internal staff, then a pilot customer group, and finally the general population. Which deployment model fits?
- Separate rollout from rollback triggers
- Use canary deployment for small initial exposure
- Use deployment rings for population sequencing
- Use Azure App Configuration Feature Manager
- Use A/B testing for behavioral comparison
Explanation
Correct Answer
C:Ring-based rollout promotes the same version through predefined user or device cohorts with validation between rings.
Incorrect Answers
A:Rollout gates should watch production health indicators and initiate rollback or halt when configured thresholds are violated; this solves health-based rollout abort, leaving ordered cohort rollout unresolved.
B:Canary deployment exposes a new version to a limited traffic subset before broadening it based on monitored results; this option addresses low-percentage release exposure rather than addressing ordered cohort rollout.
D:App Configuration feature management stores flag definitions and enables supported application frameworks to evaluate feature state; ordered cohort rollout remains outside the responsibility of centralized application feature controls.
E:A/B testing assigns experiences to comparable cohorts and measures defined outcome metrics rather than focusing solely on release safety; that acts on controlled user-experience experiment, whereas the requested outcome is ordered cohort rollout.
Question 383
A regulated AKS release must reject container images with known vulnerable packages and then deploy exactly the image that passed verification. Which TWO controls should be used? Choose TWO.
- Build a multi-stage Docker image
- Push build images to Azure Container Registry
- Tag an image using a source revision
- Scan container images before promotion
- Deploy images by digest rather than moving tag
Explanation
Correct Answers
D:Container image vulnerability scanning inspects packaged layers and known component vulnerabilities before production use.
E:Content-addressed image digests tie the deployment manifest to exact image bytes, preserving the tested artifact identity; digest pinning guarantees that the deployed image is the one assessed by the separate scanning requirement.
Incorrect Answers
A:Multi-stage builds copy final outputs from a builder stage into a smaller runtime stage without shipping build-only dependencies; although that supports runtime image minimization, this scenario calls for image-layer vulnerability screening.
B:Azure Container Registry stores private container images and artifacts with Azure-integrated identity and access controls; image-layer vulnerability screening cannot be inferred from Azure-native private image storage alone.
C:Including an immutable commit identifier in the image tag helps correlate build output to the exact source change; the distinction is commit-specific container traceability versus image-layer vulnerability screening.
Question 384
Build output retention appears unchanged, but stored gigabytes keep rising and costs are increasing. Which inventory should be examined?
- Set cancellation timeout for cleanup
- Audit changed pipeline definitions
- Monitor artifact storage growth
- Diagnose self-hosted agent exhaustion
Explanation
Correct Answer
C:Artifact count, size, age, and retention-policy exceptions identify accumulating outputs and unexpected storage consumption.
Incorrect Answers
A:Cancellation grace settings allow eligible cleanup work limited time to finish after a run is canceled; retained build data growth falls outside the scope of graceful cancellation finalization.
B:Pull request and Git commit history for pipeline-as-code records who changed the definition and what was approved; it contributes to audit trail for automation changes, with retained build data growth still requiring its own control.
D:Agent utilization and queue length reveal whether workload demand exceeds available qualified worker capacity; this option addresses peak worker utilization shortage rather than addressing retained build data growth.
Question 385
Security engineers want dataflow-aware detection of code vulnerabilities during GitHub pull request workflows. Which scanning technology should be configured?
- Enable CodeQL code scanning for supported repositories
- Configure Dependabot security updates
- Require secret scan checks before publishing
- Run CodeQL analysis inside a controlled container
Explanation
Correct Answer
A:CodeQL analyzes code using language-aware queries and can surface findings through GitHub code scanning. Configure the appropriate language analysis and pull-request integration, then triage findings before promotion.
Incorrect Answers
B:Dependabot security updates can generate upgrade pull requests for vulnerable dependencies when compatible fixes exist; here static code vulnerability analysis is the target, not automated vulnerable-package remediation PR.
C:Secret detection applied to source and built artifacts can block distribution when sensitive credential patterns are found; although that supports prepublication credential leakage gate, this scenario calls for static code vulnerability analysis.
D:Running the supported CodeQL analysis workflow in a managed container isolates scanner tooling and makes its runtime dependencies repeatable across builds; static code vulnerability analysis cannot be inferred from isolated static-analysis execution environment alone.
Question 386
Developers should propose changes through pull requests, even when they can create branches and collaborate normally. Which repository restriction achieves this?
- Restrict allowed merge types
- Enforce a required GitHub ruleset across repositories
- Require resolved pull request comments
- Restrict direct pushes to the default branch
Explanation
Correct Answer
D:Protected branch rules and targeted permissions can stop direct updates and require approved pull request workflows.
Incorrect Answers
A:Merge-type policy restricts which pull request completion methods are permitted for the target branch; that changes permitted integration history forms without delivering enforcing reviewed branch updates.
B:Organization-level GitHub rulesets can apply coordinated policy conditions to selected repositories and branches; centrally governed repository protections cannot substitute for enforcing reviewed branch updates.
C:A comment resolution policy prevents completion while unresolved review threads violate the configured requirement; enforcing reviewed branch updates falls outside the scope of closed review feedback threads.
Question 387
A developer must switch branches for an urgent fix but has uncommitted experimental changes that should not become a commit. Which Git feature fits?
- Use git reset on unpublished local work
- Use git fetch before inspecting remote updates
- Use git clean for untracked build clutter
- Use git stash for temporary unfinished edits
Explanation
Correct Answer
D:git stash saves eligible uncommitted work for later reapplication, freeing the worktree for a different task. Stash the working changes before switching branches and reapply them later, resolving conflicts if the base has moved.
Incorrect Answers
A:git reset can move the branch reference and optionally change the index and working tree; it should be used carefully on private history; temporary worktree shelving remains outside the responsibility of moving an unpublished branch pointer.
B:git fetch updates remote-tracking references and transfers objects while leaving the checked-out branch unmerged; that acts on nonmerging remote history synchronization, whereas the requested outcome is temporary worktree shelving.
C:git clean removes selected untracked files and directories, with a preview option to avoid accidental deletion; untracked generated file cleanup concerns a different control point than temporary worktree shelving.
Question 388
A monorepo has a documentation-only area and code-only area; the service build should not run when only documentation changes. Which trigger control helps?
- Configure a workflow_call trigger
- Configure path-filtered CI triggers
- Use a YAML trigger exclude for maintenance branches
- Configure a manual workflow_dispatch event
- Configure a GitHub pull_request workflow trigger
Explanation
Correct Answer
B:YAML path include or exclude filters scope CI triggers to changes in specified repository paths. Scope the filter to application paths or exclude documentation paths, checking interactions with branch trigger filters.
Incorrect Answers
A:workflow_call declares a reusable workflow that other workflows invoke with defined inputs and secrets; changed-path CI eligibility cannot be delivered through cross-workflow reuse invocation.
C:Trigger exclude patterns prevent selected branch namespaces from queuing otherwise matching pipeline runs; that changes branch-pattern exclusion from CI without delivering changed-path CI eligibility.
D:workflow_dispatch supports manually started GitHub workflows and declared inputs, keeping emergency operations explicit; operator-initiated parameterized workflow cannot substitute for changed-path CI eligibility.
E:The pull_request event runs selected workflows for PR activities, enabling validation before code is merged; changed-path CI eligibility falls outside the scope of GitHub proposed-change verification.
Question 389
A security fix was already committed on main and only that fix should enter an older supported version. Which Git operation is most targeted?
- Protect production release tags
- Use short-lived feature branches with pull requests
- Squash commits when completing a pull request
- Cherry-pick a validated fix into a maintenance branch
Explanation
Correct Answer
D:Cherry-pick applies the changes introduced by a chosen commit onto the target branch without merging its entire ancestry.
Incorrect Answers
A:Protected tags and signed release practices stabilize version references and make tampering or unintended movement easier to prevent or detect; this option addresses immutable release identity rather than addressing selective cross-branch fix transfer.
B:Short-lived feature branches allow focused work and review before merging back to the primary branch; it handles reviewable isolated changes but cannot by itself deliver selective cross-branch fix transfer.
C:Squash merging combines the pull request's commits into a single new commit on the target branch; selective cross-branch fix transfer remains outside the responsibility of one logical commit per reviewed feature.
Question 390
A library pipeline needs rapid feedback about pure business-logic functions before expensive deployments start. Which test level should run earliest?
- Collect failing test logs and artifacts
- Use ephemeral test environments for parallel pull requests
- Separate flaky tests from product regressions
- Run unit tests before packaging
Explanation
Correct Answer
D:Unit tests exercise small components in isolation and are usually fast enough to provide immediate feedback during continuous integration.
Incorrect Answers
A:Publishing diagnostic logs and test-result artifacts preserves failure evidence independently of the agent workspace lifecycle; low-cost component correctness cannot be inferred from durable failed-run diagnostics alone.
B:Isolated short-lived test environments give each validation run independent dependencies and reduce cross-branch test contamination; the distinction is test dependency isolation per change versus low-cost component correctness.
C:Identify and quarantine or stabilize nondeterministic tests while recording their outcomes, rather than hiding instability with unlimited retries; low-cost component correctness cannot be delivered through nondeterministic-test root cause management.