Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Push should use bundle config and not project config. #986

Closed
nextor2k opened this issue Feb 14, 2023 · 3 comments · Fixed by #1049
Closed

[BUG] Push should use bundle config and not project config. #986

nextor2k opened this issue Feb 14, 2023 · 3 comments · Fixed by #1049
Labels
Acknowledged Team has responded to issue BUG P3 git2gus label for bug

Comments

@nextor2k
Copy link

Summary

pwa-kit-dev push should use the bundle config instead of the project config folder.

Steps To Reproduce

  1. create a build bundle with a specific config
  2. update the project config

Expected result

  1. push should deploy the bundle with the config

Actual result

  1. push try to push bundle with the project config instead bundle config

System Information (as applicable)

Node version: 14.19.1
pwa-kit version: 2.6
Desktop OS: linux

Additional information

I believe the getConfig on the pwa-kit-dev should be changed to use the one from the bundle.

async ({
    buildDirectory,
    message,
    projectSlug,
    target,
    cloudOrigin,
    credentialsFile
}) => {
    // Set the deployment target env var, this is required to ensure we
    // get the correct configuration object.
    process.env.DEPLOY_TARGET = target

    const credentials = await scriptUtils.readCredentials(credentialsFile)

    // <!> ATENTION BELLOW <!>
    // TODO: use bundle Config Folder instead Project Config Folder.
    const mobify = getConfig() || {} 

    if (!projectSlug) {
        projectSlug = await getProjectName()
    }

    const bundle = await scriptUtils.createBundle({
        message,
        ssr_parameters: mobify.ssrParameters,
        ssr_only: mobify.ssrOnly,
        ssr_shared: mobify.ssrShared,
        buildDirectory,
        projectSlug
    })
    const client = new scriptUtils.CloudAPIClient({
        credentials,
        origin: cloudOrigin
    })

    info(`Beginning upload to ${cloudOrigin}`)
    const data = await client.push(bundle, projectSlug, target)
    const warnings = data.warnings || []
    warnings.forEach(warn)
    success('Bundle Uploaded')
}
@nextor2k nextor2k changed the title [BUG] [BUG] Push should use bundle config and not project config. Feb 14, 2023
@vmarta
Copy link
Contributor

vmarta commented Feb 14, 2023

@nextor2k Let's first clarify the differences between a bundle and project configs. Is this what you were thinking of?

  • bundle config: inside /build/config folder
  • project config: inside /config folder

If that's the case, I think I see what you mean. getConfig in this line should be searching within the /build folder instead, because the intention of the push command is to push the existing bundle in the build folder.

const mobify = getConfig() || {}

Since the script already has access to buildDirectory, perhaps a bug fix would look like:

const mobify = getConfig(buildDirectory) || {}

@nextor2k
Copy link
Author

@nextor2k Let's first clarify the differences between a bundle and project configs. Is this what you were thinking of?

  • bundle config: inside /build/config folder
  • project config: inside /config folder

If that's the case, I think I see what you mean. getConfig in this line should be searching within the /build folder instead, because the intention of the push command is to push the existing bundle in the build folder.

const mobify = getConfig() || {}

Since the script already has access to buildDirectory, perhaps a bug fix would look like:

const mobify = getConfig(buildDirectory) || {}

exactly.

@vmarta vmarta added the BUG P3 git2gus label for bug label Feb 15, 2023
@git2gus
Copy link

git2gus bot commented Feb 15, 2023

This issue has been linked to a new work item: W-12546385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged Team has responded to issue BUG P3 git2gus label for bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants