# Refine and open a pull request
Source: https://docs.infraista.com/en/developer-tools/dockerfile-studio/refine-and-open-a-pull-request



## Refine with AI [#refine-with-ai]

On a ready generation, describe a change under **Refine with AI**, for example "Use port 9000" or
"install imagemagick", and select **Send**. Or use a quick action:

| Quick action                         | What it does                                                                 |
| ------------------------------------ | ---------------------------------------------------------------------------- |
| **Make it smaller**                  | Makes the final image as small as possible without changing how the app runs |
| **Use Alpine**                       | Switches to Alpine base images                                               |
| **Add a dev target with hot reload** | Adds a development stage                                                     |
| **Run tests during build**           | Adds a test stage; a failing test stops the build                            |
| **Pin base images by digest**        | Pins every base image with `@sha256:…` (no AI, never billed)                 |

Each refinement makes a new version, re-checked against the best practices. Green lines show what
changed. A generation can be refined up to 20 times; refinements don't count toward your monthly
generations, but those past the included ones are billed (see
[Settings and limits](/en/developer-tools/dockerfile-studio/settings-and-limits)).

## Edit a file yourself [#edit-a-file-yourself]

Select **Edit** on a file, change it, and **Save as a new version**. Your edit is checked like any other
version.

## Versions [#versions]

**Versions** lists every version: **Initial generation**, **Refinement**, **Quick action** or **Your
edit**. Pick one to view it, and **Use this version** to make it current. Downloads and the pull request
use the version you're viewing.

## Open a pull request [#open-a-pull-request]

1. Select **Open pull request**.
2. Check the **Branch** (always a new branch, never the base branch itself), the **Files** to include,
   the **Title** and the **Description**. "Review before merging" is always in the description.
3. Optionally add **Reviewers** (GitHub usernames) and **Labels** (not on Bitbucket), choose **Open as a
   draft**, and keep or drop the "Generated by Dockerfile Studio" footer.
4. Select **Open pull request**.

The pull request goes into the repository's default branch. Infraista opens it and leaves the review
and the merge to your team: auto-merge isn't available for AI-generated changes. The generation then
shows the pull request's status (open, merged or closed).

Defaults for the branch, reviewers, labels, drafts and the footer are set in
[Settings](/en/developer-tools/dockerfile-studio/settings-and-limits#pull-requests).

## Related [#related]

* [Generate a Dockerfile](/en/developer-tools/dockerfile-studio/generate-a-dockerfile)
* [Settings and limits](/en/developer-tools/dockerfile-studio/settings-and-limits)
